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

RE: Joining two XML-files

Subject: RE: Joining two XML-files
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 18 Oct 2001 17:29:08 +0100
join two xml files
Actually, the best solution is to join the tables while they are still in a
relational database, rather than doing it with XSLT. Relational databases
are usually quite good at joins (they get a lot of practice).

If you must do it in XSLT, set up an xsl:key definition to define the join
attribute in one file, and use the key() function while processing the other
file to bring in the matching record(s). You'll need to use the document()
function to reference the second file.

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Jorge Bello
> Sent: 18 October 2001 14:39
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Joining two XML-files
>
>
> I have 2 XML files obtained from an old legacy system.
> (each one is a copy of a relational table).
>
> Here is an excerpt of every one
> file1.xml
> <data>
>     <row att1='foo' att2='morefoo" ... />
>     <row att1='foo2' att2='morefoo2" ... />
> ...
> </data>
>
> file2.xml
> <data>
>     <row fld1='foo' fld2='otherfoo" ... />
>     <row fld1='foo2' fld2='otherfoo2" ... />
>     <row fld1='foo2' fld2='anotherfoo2" ... />
> ...
> </data>
>
> These files are related through the commom value of an attribute.
> In the previous example file1.att1  is found in file2.fld1
> I need to produce a third file where get mixed some attributes
> of the related "records".For example:
>
> file3.xml
>     <row att1='foo' att2='morefoo" fld2='otherfoo" />
>     <row att1='foo2' att2='morefoo2" fld2='otherfoo2" />
>     <row att1='foo2' att2='morefoo2" fld2='anotherfoo2" />
> ...
> </data>
>
> I'm wondering what is the "best practice" to achieve this.
> Any help will be appreciated.
>
> TIA
> Jorge
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.