We Recommend

Beginning XML Beginning XML
The perfect resource for beginning XML programmers, this guidebook shows you what XML is, how to use it, and what technologies surround it. The authors build on the strengths of previous editions while covering the latest changes in the XML landscape such as XQuery, RSS and Atom, and Ajax.


Posted By

greystate on 07/05/06


Tagged

template xslt


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

greystate
fukami


Built-in templates in XSLT


Published in: XML 


You need to know about [the presence of] these to understand the processing of an XSLT stylesheet.

  1. <!-- Element or root node: Process children -->
  2. <xsl:template match="* | /">
  3. <xsl:apply-templates />
  4. </xsl:template>
  5.  
  6. <!-- Element or root in specific mode: Process children in that mode -->
  7. <xsl:template match="* | /" mode="m">
  8. <xsl:apply-templates mode="m" />
  9. </xsl:template>
  10.  
  11. <!-- Text or attribute node: Output value -->
  12. <xsl:template match="text() | @*">
  13. <xsl:value-of select="." />
  14. </xsl:template>
  15.  
  16. <!-- PI or comment node: Hide from result -->
  17. <xsl:template match="processing-instruction() | comment()" />

Report this snippet 

You need to login to post a comment.