Subject: RE: replace value using two xml
From: "Roger Glover" <glover_roger@xxxxxxxxx>
Date: Mon, 3 Feb 2003 15:58:24 -0600
|
miguel aviles wrote:
> I have two xml files, saying
>
> File1.xml:
>
> <n a1="v1" a2="v2" a3="v3" />
>
> File2.xml:
>
> <v1>a1="nv1" a2="nv2" a3="nv3"</v1>
>
> I want to replace v1 with nv1 in file1.xml
Errr... then I don't understand why you need "File2.xml".
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*/[.='v1']" >
<xsl:attribute name="name()">nv1</xsl:attribute>
</xsl:template>
How you go about deleting "File1.xml" and renaming the result document
"File1.xml" is system dependent.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|