Posted By

qrist0ph on 05/13/08


Tagged

xslt helloworld


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

izachega
kaartz
gelogenic
Tyster


XSLT Hello World


 / Published in: XML
 

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4. <xsl:template match="/"> <h1>ROOT</h1> <xsl:apply-templates select="descendant::a"/> </xsl:template>
  5.  
  6. <xsl:template match="level0"> <xsl:value-of select="b"/> <p>Sum: <xsl:value-of select="descendant::l1e" /></p> <xsl:apply-templates select="level1"/> </xsl:template>
  7.  
  8. <xsl:template match="enum"> <option><xsl:value-of select="@match"/> - <xsl:value-of select="@name"/></option> </xsl:template>
  9.  
  10. <xsl:template match="level1"> <p>mult: <xsl:value-of select="l1e * ../b[3]" /></p> </xsl:template>
  11.  
  12. <xsl:template match="a"> <h4><xsl:value-of select="." /></h4> </xsl:template>
  13.  
  14. </xsl:stylesheet>

Report this snippet  

You need to login to post a comment.