XSLT Example


<xsl:template> Element

Contains a template that applies rules when a specified node is matched.

Example explained


<xsl:value-of> Element

Extracts the value of a selected node.

Example explained


<xsl:for-each> Element

Selects every XML element of a specified node set with the <xsl:for-each> element.

Filter the output of the node set.

Example explained


<xsl:sort> Element

Sort the output of the node set.

Example explained


<xsl:if> Element

Places a conditional test against the content of the XML file.

Example explained


<xsl:choose> Element

Example 1
This example will add a pink background color to the "Artist" column when the CD price is higher than 10.

Example 2
This example will add a pink background color to the "Artist" column when the CD price is higher than 10, and add a gray background color to the "Artist" column when the CD price is higher than 9 and less than or equal to 10.

Example explained


<xsl:apply-templates> Element

Applies a template to an element.

Example explained


Other extensions