dleslie 00/05/03 11:17:39
Modified: c/samples/ExternalFunction foo.xml foo.xsl Log: XML document and stylesheet organized around the square-root, cube, and Asctime extension functions. Revision Changes Path 1.2 +4 -1 xml-xalan/c/samples/ExternalFunction/foo.xml Index: foo.xml =================================================================== RCS file: /home/cvs/xml-xalan/c/samples/ExternalFunction/foo.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- foo.xml 2000/05/01 14:57:49 1.1 +++ foo.xml 2000/05/03 18:17:37 1.2 @@ -1,2 +1,5 @@ <?xml version="1.0"?> -<doc>Hello</doc> +<doc> + <area value="397" units="mm"/> + <now/> +</doc> 1.2 +29 -6 xml-xalan/c/samples/ExternalFunction/foo.xsl Index: foo.xsl =================================================================== RCS file: /home/cvs/xml-xalan/c/samples/ExternalFunction/foo.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- foo.xsl 2000/05/01 14:57:49 1.1 +++ foo.xsl 2000/05/03 18:17:38 1.2 @@ -1,10 +1,33 @@ <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" - xmlns:external="http://ExternalFunction.xalan-c++.xml.apache.org"> - <xsl:template match="doc"> - <out><xsl:value-of select="external:cube(external:square-root(9))"/></out> - <xsl:text> -</xsl:text> - <out><xsl:value-of select="asctime()"/></out> + xmlns:external="http://ExternalFunction.xalan-c++.xml.apache.org.xxx" + exclude-result-prefixes="external"> + + <xsl:template match="/"> + <out> + <xsl:apply-templates/> + </out> + </xsl:template> + + <xsl:template match="//area"> + <given> + The area of each face of the cube is <xsl:value-of select="@value"/> + <xsl:text> square units </xsl:text> <xsl:value-of select="@units"/>. + </given> + <result> + Accordingly, the length of each side is <xsl:value-of select="external:square-root(@value)"/> + <xsl:text> </xsl:text><xsl:value-of select="@units"/> and the volume of the cube is + <xsl:value-of select="external:cube(external:square-root(@value)))"/> + <xsl:text> cubic </xsl:text> <xsl:value-of select="@units"/>. + </result> </xsl:template> + + <xsl:template match="now"> + <when> + Date and time when we figured all this out: <xsl:value-of select="asctime()"/>. + </when> + </xsl:template> + </xsl:stylesheet> + +
