13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table 7-1: XSLT Instructions <strong>for</strong> TemplatesInstructionDescriptiontemplates to the elements thatmatch the XPath description.The select attribute selects thetarget elements. In general, as<strong>in</strong>gle element can be affectedby multiple templates.Executes the specified template.The name attribute <strong>in</strong>dicates thename of the previously declaredtemplate to execute.Def<strong>in</strong>es a <strong>for</strong>mal argument <strong>for</strong> anamed template. The nameattribute <strong>in</strong>dicates the name ofthe argument. The parametercan have a default argument.You specify a default value us<strong>in</strong>geither an XPath expression (viathe select attribute) or a templateas the body of the element.Def<strong>in</strong>es an actual parameter <strong>for</strong>a template call. The nameattribute <strong>in</strong>dicates the match<strong>in</strong>gparameter. The actual value canbe expressed us<strong>in</strong>g either anXPath expression (via the selectattribute) or the body of theelement.When you set the select attribute, the template (or the parameter) will execute <strong>in</strong> thecontext of the selected nodes. Any further XPath expression to locate the text of aparticular node or attribute must be based <strong>in</strong> that context.Data Manipulation InstructionsThe commands listed <strong>in</strong> Table 7-2 are helpful <strong>for</strong> extract<strong>in</strong>g data out of source nodesand then preprocess<strong>in</strong>g it us<strong>in</strong>g <strong>in</strong>-place code.Table 7-2: XSLT Instructions <strong>for</strong> Data ManipulationInstructionDescription Returns the value of thespecified attribute or the textassociated with the given node.You select nodes us<strong>in</strong>g XPathexpressions. Of course,attributes must be prefixed withan at sign (@). This commandworks more or less as a macrothat expands at run time.Returns the entire node-set thatcorresponds to the results of241

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!