• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Power XML for Web Pages > 63. Use Client-Side XPath

Use Client-Side XPath

Use XPath to enhance your XSL transformations.

XPath defines a syntax for selecting parts of an XML document. It consists of syntax to select direct elements and their attributes, as well as a set of standard functions. XPath was released as a W3C recommendation in 1999 and is such a major element of XSL that without it, you will not be able to make XSL documents. This hack serves to dirty your hands with basic XPath syntax.

XPath syntax is a superset of the standard patterns that are used to apply templates to XML elements using the match attribute of the xsl:template element. Patterns allow you to say which nodes you do and do not wish to match for a transformation. Basic patterns allow you to match nodes by element name, child elements, descendants, and attributes. The XPath superset allows matching on much more powerful expressions. These expressions can be used in any XSL element that allows a select attribute. Currently, that means these tags: xsl:apply-templates, xsl:value-of, xsl:for-each, xsl:copy-of, xsl:variable, xsl:param, and xsl:sort.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint