20.01.2015 Views

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

distinguished from other elements that may be within an XSLT document by its<br />

association with a namespace. Declaring this namespace in the XSLT root element<br />

(xsl:stylesheet or xsl:transform) was shown in Example 6.6, “XSL Simple Stylsheet File”<br />

[6–9].<br />

Table Table 6.1, “XSLT Elements” [6–10] contains a list of the elements defined in version<br />

1.0 of the XSLT specification. Notice that each element contains the xsl: prefix. This list<br />

contains information from Microsoft's XSLT Elements table<br />

[http://msdn2.microsoft.com/en-us/library/ms256058(VS.80).aspx], SAXON's XSLT<br />

Elements table [http://saxon.sourceforge.<strong>net</strong>/saxon6.5.2/xsl-elements.html], and Dan<br />

Wahlin's XSLT Elements table (from Chapter 7 of his XML for ASP.NET Developers)<br />

[http://www.topxml.com/dot<strong>net</strong>/articles/xslt/default.asp].<br />

Table 6.1. XSLT Elements<br />

XSLT Element<br />

xsl:apply-imports<br />

xsl:apply<br />

-templates<br />

xsl:attribute<br />

xsl:attribute-set<br />

xsl:call-template<br />

xsl:choose<br />

xsl:comment<br />

xsl:copy<br />

xsl:copy-of<br />

Description<br />

This is used in conjunction with imported style sheets to override<br />

templates within the source style sheet. Calls to xsl:apply-imports<br />

cause an imported template with lower precedence to be invoked<br />

instead of the source style sheet template with higher precedence.<br />

When xsl:apply-templates is used, the XSLT processor finds the<br />

appropriate template to apply, based on the type and context of each<br />

selected node.<br />

This creates an attribute node that is attached to an element that<br />

appears in the output structure.<br />

This is used when a commonly defined set of attributes will be<br />

applied to different elements in the style sheet. This is similar to<br />

named styles in CSS.<br />

This is used when processing is directed to a specific template. The<br />

template is identified by name.<br />

This is used along with the xsl:otherwise and xsl:when elements to<br />

provide conditional testing. Similar to using a switch statement in C#<br />

or Select Case statement in VB.NET.<br />

Writes a comment to the output structure.<br />

Copies the current node from the source document to the result tree.<br />

The current node's children are not copied.<br />

This is used to copy a result-tree fragment or node-set into the result<br />

tree. This performs a "deep copy," meaning that all descendants of<br />

the current node are copied to the result tree.<br />

xsl:decimal -format Declares a decimal-format that is used when converting numbers into<br />

strings with the format-number() function.<br />

6–10

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

Saved successfully!

Ooh no, something went wrong!