topical media & game development

talk show tell print

basic-xml-08-Ages.xsl / xsl



  <?xml version='1.0'?>
  <xsl:stylesheet
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0"
   >
  <xsl:param name="person" />
  
  <xsl:template match="/">
   <html>
    <head>
     <title>Finding an age using an XSLT parameter</title>
    </head>
    <body>
     <xsl:apply-templates select="/Ages/Person[@name=person]" />
    </body>
   </html>
    
  </xsl:template>
  
  <xsl:template match="Person">
  <p>The age of <xsl:value-of select="person" /> is <xsl:value-of select="@age" /></p>
  </xsl:template>
  
  </xsl:stylesheet>


(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.