David Schwartz wrote:
Actually, both stylesheets produce a file with the same number of
elements. The stylesheet you provided David does include the
attributes though so thanks!
So, now that I'm successfully creating all the tags, how do I change
the values of the ref attribute in just the tagC elements?
As suggested earlier:
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<redirect:write file="transformed.xml">
<xsl:apply-templates/>
</redirect:write>
</xsl:template>
<xsl:template match="@id2"/>
<xsl:template match="tagC">
<xsl:copy>
<xsl:attribute name="ref">
<xsl:value-of select="../*[@id2 = current()/@ref]/@id1"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
--
Martin Honnen
http://JavaScript.FAQTs.com/
|