topical media & game development

talk show tell print

basic-xml-07-Books.xsl / xsl

   xmlns:xsl="" >
  <xsl:template match="/">
     <title>This shows the context position and context size.</title>
     <h3>Context position and context size demo.</h3>
     <xsl:apply-templates select="/Book/Chapter" />
  <xsl:template match="Chapter">
   <xsl:if test="position()=2">
   <p>When the context node is the second <b>Chapter</b> element node then</p>
   <p>the context position is <xsl:value-of select="position()" /></p>
   <p>and the context size is <xsl:value-of select="last()" />.</p>
   <p>The text the <b> Chapter</b> element node contains is '<xsl:value-of select="." />'.</p>

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.