Hi! I'm seeking for someone who can explain what I am doing wron with the position() function. Asume following xml file:
<?xml version='1.0'?> <top> <sub>one</sub> <sub>two</sub> <sub>three</sub> </top> Then here is a XSL(T) stylesheet ?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="top"> A List <xsl:apply-templates/> </xsl:template> <xsl:template match="sub"> <xsl:value-of select="position()"/> <xsl:text>) </xsl:text> <xsl:value-of select="."/> </xsl:template> </xsl:stylesheet> which gives the following output: <?xml version="1.0"?> A List 2) one 4) two 6) three This is just fine. Besides is there a simple way to make it output 1, 2 and 3? Now I habe an XPathScript Stylesheet which I would presume to give the same outtput: <% $t->{'top'}{pre} = "A List\n\n"; $t->{'sub'}{pre} = findvalue('position()') . ") "; print apply_templates(); %> But instead it gives: A List ) one ) two ) three Which puttles me quite a lot, and moreover prevents me from writing a stylesheet to convert our in-house XML int lout for printing (as no free XSL-FO processor is able to do tables without pre-fixed coulumn-width I'm going this way). Any help is very welcome. Best regards Olaf -- Olaf P�schel, Softwaretechnik, OLMOS Workstations GmbH, Germany Wolfenb�tteler Str. 31A, 38102 Braunschweig, Fon.: +49-531-22020-0 Fax: -99 OLMOS supports signed and/or encrypted mail. Grab my key at www.keyserver.net "Unix *is* user friendly. It's just a bit picky about its friends" --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
