dmarston 2002/06/24 07:24:12 Added: test/tests/conf/position position102.xsl position102.xml pos102imp.xsl Log: Test associated with Bugzilla #10176 Revision Changes Path 1.1 xml-xalan/test/tests/conf/position/position102.xsl Index: position102.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: position102 --> <!-- Document: http://www.w3.org/TR/xslt --> <!-- DocVersion: 19991116 --> <!-- Section: 5.6 --> <!-- Creator: David Marston, from an idea by Kai Ojansuu --> <!-- Purpose: Test position() when template is imported. --> <xsl:import href="pos102imp.xsl"/> <xsl:output method="xml" indent="no" encoding="UTF-8"/> <xsl:template match="doc"> <out> <xsl:apply-templates select="a"/> <xsl:apply-templates select="b"/> <xsl:apply-templates select="c"/> </out> </xsl:template> <xsl:template match="a"> <xsl:text> </xsl:text> <local> <xsl:text>Item </xsl:text> <xsl:value-of select="@mark"/> <xsl:text> is in position </xsl:text> <xsl:value-of select="position()"/> </local> </xsl:template> <xsl:template match="c"> <xsl:text> </xsl:text> <apply level="main"> <xsl:text>Item </xsl:text> <xsl:value-of select="@mark"/> <xsl:text> is in position </xsl:text> <xsl:value-of select="position()"/> </apply> <xsl:apply-imports/> </xsl:template> </xsl:stylesheet> 1.1 xml-xalan/test/tests/conf/position/position102.xml Index: position102.xml =================================================================== <?xml version="1.0"?> <doc> <a mark="a1"/> <b mark="b1"/> <c mark="c1"/> <c mark="c2"/> <a mark="a2"/> <a mark="a3"/> <b mark="b2"/> <c mark="c3"/> <b mark="b3"/> </doc> 1.1 xml-xalan/test/tests/conf/position/pos102imp.xsl Index: pos102imp.xsl =================================================================== <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- FileName: pos102imp --> <!-- Purpose: To be imported by position102. --> <xsl:template match="b"> <xsl:text> </xsl:text> <direct> <xsl:text>Item </xsl:text> <xsl:value-of select="@mark"/> <xsl:text> is in position </xsl:text> <xsl:value-of select="position()"/> </direct> </xsl:template> <xsl:template match="c"> <xsl:text> </xsl:text> <apply level="import"> <xsl:text>Item </xsl:text> <xsl:value-of select="@mark"/> <xsl:text> is in position </xsl:text> <xsl:value-of select="position()"/> </apply> </xsl:template> </xsl:stylesheet>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]