[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: replace value using two xml

Subject: RE: replace value using two xml
From: "Roger Glover" <glover_roger@xxxxxxxxx>
Date: Mon, 3 Feb 2003 15:58:24 -0600
xsl replace value
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.