[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Problem Copying an element, always getting first in the list


Subject: Re: [xsl] Problem Copying an element, always getting first in the list
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Tue, 08 Feb 2005 17:04:35 +0100

Tempore 16:52:03, die 02/08/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Sian Mace <sianmace@xxxxxxxxxxx>:

You can see that the ASIN is copying the first one in the iteration each time, and not the correct one for example Jims ASIN wich is 54321!!

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>


<xsl:template match="@*|node()">
       <xsl:copy>
           <xsl:apply-templates select="@*|node()"/>
       </xsl:copy>
</xsl:template>

<xsl:template match="/Tests/Test/Attributes">
   <xsl:copy>
           <xsl:apply-templates select="@*|node()"/>
       <asin><xsl:value-of select="../ASIN"/></asin>
       </xsl:copy>
   </xsl:template>

</xsl:stylesheet>

don't use absolute paths (starting with '/') unless you're really need them.

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Gaudiam omnibus traderat W3C, nec vana fides


Current Thread