Subject: Re: [xsl] Merge 2 xmls : Loop through one xml and get elements from second xml From: "Prady Prady prady.chin@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 1 Sep 2020 14:27:13 -0000 |
Can we do this with call-templates? On Tue, 1 Sep 2020 at 09:51, Prady Prady prady.chin@xxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Is there any other simpler way.. > > All I have to do is: > > Loop thru first xml: > add elements from first xml > get "amount" from second xml where order number matches and create this > Or > > Can you explain what is being done? > > Thank you very much for your response... > > > On Tue, 1 Sep 2020 at 08:49, 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) . >> >> >> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3397216> (by > email <>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Merge 2 xmls : Loop throu, Prady Prady prady.ch | Thread | Re: [xsl] Merge 2 xmls : Loop throu, Liam R. E. Quin liam |
Re: [xsl] Merge 2 xmls : Loop throu, Prady Prady prady.ch | Date | Re: [xsl] Merge 2 xmls : Loop throu, Martin Honnen martin |
Month |