Creating Match Patterns

As you might expect from the discussion on how "child::MASS" can be abbreviated as "MASS", and the use of patterns such as "/", "/PLANETS", and so on, it’s going to take a little work to get thoroughly familiar with creating match patterns— Chapter 4 is devoted to doing that.

Match patterns are a subset of the full XPath language, and you use them in <xsl:template>, <xsl:key>, and <xsl:number>. In particular, you can set the match attribute of <xsl:template> and <xsl:key>, and the count and from attributes of <xsl:number> to a pattern. The following list includes a few examples of match patterns; you’ll see many more in Chapter 4 during the detailed discussion on using Xpath to select nodes and attributes:

  • "/" Matches ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.