|
Subject: Re: [xsl] Reading two xmls and changing the attribute names in the first xml conditionally From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Wed, 06 Jul 2005 11:05:35 +0200 |
6) Can any one send me the xsl code for this scenario.consider that the scond file is named 'second.xml' and the stylesheet is processed on the first file.
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="@*">
<xsl:with-param name="Type" select="@Type"/>
</xsl:apply-templates>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:param name="Type"/>
<xsl:variable name="name" select="local-name()"/>
<xsl:variable name="newname">
<xsl:for-each select="document('second.xml')">
<xsl:value-of select="key('newName',concat($Type,$name))/@name"/>
</xsl:for-each>
</xsl:variable>
<xsl:attribute name="{$newname}"><xsl:value-of select="."/></xsl:attribute>
</xsl:template>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Spread the wiki (http://www.wikipedia.org)
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Reading two xmls and changing, Lakshmi narayana | Thread | RE: [xsl] Reading two xmls and chan, Lakshmi narayana |
| Re: [xsl] Reading two xmls and chan, jeb501 | Date | [xsl] [OT] entity defintions, Dan |
| Month |