[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Merge two XML files


Subject: Re: [xsl] Merge two XML files
From: Rob Rohan <me@xxxxxxxxxxxx>
Date: 29 Apr 2003 19:05:36 -0700

I don't know if this will help, but I am writing the same kind of
process. You can see the sheet here
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ashpool/Tessier/com/rohanclan/ashpool/libxslt/doJoin.xsl

(watch for line wrap)

What you are talking about is similar to an SQL join if I understand you
correctly and that is what that sheet does. It doesn't use keys yet and
it is not bug free, but it might give you some ideas.

Cheers,
Rob Rohan

http://treebeard.sourceforge.net
http://ashpool.sourceforge.net


On Tue, 2003-04-29 at 18:01, Kim Tran wrote:
> I have 2 XML files that I want to be able to merge them together given a 
> list of keys.  I have searched the group but the examples are slightly 
> different than ours.  Our XML files have the following format:
> XML1.xml
> 
> <Document>
>   <row>
>     <column name="FirstName">Smith</column>
>     <column name="LastName">John</column>
>     <column name="Address">7777 First </column>
>   </row>
>   <row>
>     <column name="FirstName">Smith2</column>
>     <column name="LastName">John2</column>
>     <column name="Address">7777 Second </column>
>   </row>
> ...
> </Document>
> 
> XML2.xml
> <Document>
>   <row>
>     <column name="FirstName">Smith</column>
>     <column name="LastName">John</column>
>     <column name="Age">36</column>
>   </row>
>   <row>
>     <column name="FirstName">Smith2</column>
>     <column name="LastName">John2</column>
>     <column name="Age">40</column>
>   </row>
> ...
> </Document>
> 
> The result XML should be:
> <Document>
>   <row>
>     <column name="FirstName">Smith</column>
>     <column name="LastName">John</column>
>     <column name="Address">7777 First </column>
>     <column name="Age">36</column>
>   </row>
>   <row>
>     <column name="FirstName">Smith2</column>
>     <column name="LastName">John2</column>
>     <column name="Address">7777 Second </column>
>     <column name="Age">40</column>
>   </row>
> ...
> </Document>


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



Current Thread
Keywords