Subject: Re: [xsl] Generating attributes from the position of an element From: Michael Kay <mike@xxxxxxxxxxxx> Date: Wed, 02 Jun 2010 11:08:04 +0100 |
Dear All,Given this source document:
Thanks for your answers, Michael I tried it out and it worked, however, I have not so far managed to install Saxon to my Mac, so as a temporal solution I am using a Firefox adds-on, called "Get XSLT results" and it has two options for creating transformations, one is the Saxon 9B, and the other one is called "Built-in XSLT", if I am trying with the Saxon 9B option, it does not generate the id for this
<text> <w ID=" " >car</w> <w ID=" ">dog</w> <w ID=" ">cat</w> <w ID=" ">house</w> </text>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="@ID"> <xsl:attribute name="Id"> <countNo><xsl:number count="w"/></countNo> </xsl:attribute> </xsl:template>
<?xml version="1.0" encoding="UTF-8"?><text> <w Id="1">car</w> <w Id="2">dog</w> <w Id="3">cat</w> <w Id="4">house</w> </text>
Michael Kay Saxonica
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Generating attributes fro, Gábor Tóth | Thread | [xsl] compose my document dynamicly, Red Light |
Re: [xsl] Generating attributes fro, Gábor Tóth | Date | [xsl] Applying XSL transformation t, Christian Schouten |
Month |