xsl-list
[Top] [All Lists]

RE: replace value using two xml

2003-02-03 14:58:24
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



<Prev in Thread] Current Thread [Next in Thread>