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

Re: Merge 2 xmls : Loop through one xml and get elemen

Subject: Re: Merge 2 xmls : Loop through one xml and get elements from second xml
From: "Gayanthika Udeshani gudeshani@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 1 Sep 2020 13:32:04 -0000
Re:  Merge 2 xmls : Loop through one xml and get elemen
you can use,

 <xsl:variable name="docs" select="*for* *$f* *in* (*$first_xml*,
*$second_xml*) *return* *document*(*$f*)" as="document-node()*"/>

or you can create a XML pipeline using ant scripts, where you merge the two
XML files then process it to create the 3rd XML file.

On Tue, Sep 1, 2020 at 6:18 PM Martin Honnen martin.honnen@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Am 01.09.2020 um 14:41 schrieb Prady Prady prady.chin@xxxxxxxxx:
>
> > But I need to use only XSLT 1.0
>
> Declare
>
> <xsl:param name="doc2" select="document('Orders_Part2.xml')"/>
>
> and a key
>
> <xsl:key name="order" match="order" use="order_number"/>
>
> then use
>
> <xsl:template match="order">
>    <xsl:copy>
>      <xsl:apply-templates select="@* | node()"/>
>      <xsl:variable name="ordernumber" select="order_number"/>
>      <xsl:for-each select="$doc2">
>        <xsl:apply-templates select="key('order', $ordernumber)/amount"/>
>      </xsl:for-each>
>    </xsl:copy>
> </xsl:template>
>
> plus the identity transformation
>
> <xsl:template match="@* | node()">
>    <xsl:copy>
>      <xsl:apply-templates select="@* | node()"/>
>    </xsl:copy>
> </xsl:template>
>
>
>
> >>>     =================
> >>>     Merge 2 xmls : Loop through one xml and get elements from second
> xml
> >>>
> >>>     I have 2 xmls(Orders_Part1.xml,Orders_Part2.xml). I have to build
> the
> >>>     3rd xml ( Orders.xml) .

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.