Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - How to increment a value? >Thread Next - Re: How to increment a value? Re: How to increment a value?To: NULL Date: 12/4/2005 2:18:00 PM <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:copy>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="row[position()=1]">
<row>
<xsl:copy-of select="key"/>
<uid>
<xsl:value-of select="uid + 1"/>
</uid>
</row>
</xsl:template>
</xsl:stylesheet>
"stoggers" <stoggers@d...> wrote in message
news:DEB6079D-4342-4904-9A90-E44C45492F10@m......
> Hi,
>
> I have the following file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <table>
> <row>
> <key>AAAAAA</key>
> <uid>1234</uid>
> </row>
> <row>
> <key>AAAAAA</key>
> <uid>1234</uid>
> </row>
> </table>
>
> And I would like to increment the value in 'uid' on just the first 'row'.
>
> How would I achieve this?
>
> Thanks,
>
> Stoggers.
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
