Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Increment with letters >Thread Next - Re: Increment with letters Re: Increment with lettersTo: NULL Date: 4/10/2006 1:59:00 AM
Hi Mark,
Below there is a sample stylesheet that processes the document once
with apply-templates and at the end with a for-each and outputs in both
cases the footnotes with alphabetic numbering using the xsl:number
instruction.
XML
<Data>
<Country KEY="001">
<Indicator KEY="001" FootnoteKEY="2" Footnote="Footnote2">
</Indicator>
<Indicator KEY="002" FootnoteKEY="" Footnote=""> </Indicator>
<Indicator KEY="003" FootnoteKEY="5" Footnote="Footnote5">
</Indicator>
<Indicator KEY="004" FootnoteKEY="6" Footnote="Footnote6">
</Indicator>
<Indicator KEY="005" FootnoteKEY="" Footnote=""> </Indicator>
</Country>
</Data>
XSLT
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:apply-templates/> At the end: <xsl:for-each
select="/Data/Country/Indicator[@Footnote!='']"> [<xsl:number
format="a" count="Indicator[@Footnote!='']"/> - <xsl:value-of
select="@Footnote"/>] </xsl:for-each>
</xsl:template>
<xsl:template match="Indicator[@Footnote!='']"> In processing:
[<xsl:number format="a" count="Indicator[@Footnote!='']"/> -
<xsl:value-of select="@Footnote"/>] </xsl:template>
</xsl:stylesheet>
Output
In processing: [a - Footnote2]
In processing: [b - Footnote5]
In processing: [c - Footnote6]
At the end:
[a - Footnote2]
[b - Footnote5]
[c - Footnote6]
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
