XPath Kick Start: Navigating XML with XPath 1.0 and 2.0
Understanding the match and select Attributes
There are two different XSLT attributes that you assign XPath expressions tothe match and the select attributes. You can use the match attribute with the <xsl:template> element, and the select attribute can be used in the <xsl:apply-templates> , <xsl:value-of> , <xsl:for-each> , <xsl:copy-of> , and <xsl: sort > XSLT elements. The match attribute is restricted to using the current node or direct child nodes. In other words, you can only use the self and the child axesjust those twowith the match attribute. So in XSLT, match= axis :: node-test [ predicate ] is legal only if axis is the self or the child axis. This restriction was made to make implementing XSLT processors easier.
There are no restrictions on the XPath expressions you can assign to the select attribute. This attribute can be used in the <xsl:apply-templates> , <xsl:value-of> , <xsl:for-each> , <xsl:copy-of> , and <xsl:sort> XSLT elements, and we'll see most of these elements in this chapter. |