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

RE: Copying of nodes

Subject: RE: Copying of nodes
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 18 Apr 2001 15:51:38 +0100
RE:  Copying of nodes
> How can I combine the subelements of a given node of two xml files?
> 
> The xml files:
> 
> file1.xml
> <root>
>    <data>
>      <a>...</a>
>      <a>...</a>
>      <b>...</b>
>    </data>
> </root>
> 
> file2.xml
> <root>
>    <data>
>      <a>...</a>
>      <b>...</b>
>      <b>...</b>
>    </data>
> </root>
> 
> The resulting file should look like this one:
> 
> <root>
>    <data>
>      <a>...</a>    (1st <a> from file1)
>      <a>...</a>    (2nd <a> from file1)
>      <a>...</a>    (1st <a> from file2)
>      <b>...</b>    (1st <b> from file1)
>      <b>...</b>    (1st <b> from file2)
>      <b>...</b>    (2nd <b> from file2)
>    </data>
> </root>
> 

<xsl:template match="/">
  <root><data>
    <xsl:for-each select="/root/data/* | document('xxx')/root/data/*">
    <xsl:sort select="name()"/>
    <xsl:copy-of select="."/>
    </xsl:for-each>
  </data></root>
</xsl:template>

Mike Kay
Software AG 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Copying of nodes
    • Martin Renner - Wed, 18 Apr 2001 10:07:28 -0400 (EDT)
      • Michael Kay - Wed, 18 Apr 2001 10:49:15 -0400 (EDT) <=
      • <Possible follow-ups>
      • Java XML - Wed, 18 Apr 2001 10:22:10 -0400 (EDT)

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.