|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Number formatting with <xsl:number />
Hi!
I'm using Xeena 1.1 to create HTML files from XML files.
I'm dealing with a list of <option> elements which should be displayed in
a table, each row one element. To make it a little more readable, I would
have to have an index (formatted as a), b), c) ...) for each row. To
obtain the current index I count the preceding-sibling::option axis. This
all works pretty well, just when I want to convert the numerical index
into the corresponding letter, the XSL engine can't parse the stylesheet
anymore.
The code I'm using looks like this:
<xsl:template match="option" mode="HTML">
<xsl:variable name="rowIndex"><xsl:value-of
select="count(preceding-sibling::option)"/></xs:variable>
<TR>
<TD>
<xsl:number value="number($rowIndex+1)"
format="a"/>
</TD>
<TD>
further row content
</TD>
</TR>
</xsl:template>
The error message is pretty meaningless:
XSL Error: SAX Exception, Location file: option.xsl, line 15, offset 62
(which is actually the closing angle bracket of the <xsl:number/> tag)
If I replace the
<xsl:number value="number($rowIndex+1)" format="a"/>
tag with
<xsl:value-of select="number($rowIndex+1)"/>
I get the index I want, just as number and not as a letter. Since I
already use numbers for a different level of nested list, this would cause
confusion and I don't want to get into hierarchical numbering, because
this would make the column pretty wide (besides I would also want to do
that with <xsl:number> and not manually).
What do I do wrong? Or doesn't the XSLT engine in built-in Xeena support
<xsl:number>? I thought that was a mandatory element...
Any ideas?
Thanx in advance,
Ragnar
Attachment:
smime.p7s
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








