Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Joining XML files?

From: "rhino" <No.offline.contact.please@---------.--->
To: NULL
Date: 7/1/2008 4:03:00 PM

I'm very new to XML and maybe just a touch impatient because I'm going to 
ask a moderately advanced question even though I'm just learning the basics.

I've spent many years working with databases, both hierarchical and 
relational. So far, XML is obviously hierarchical in nature. I'm wondering 
if there is anything analogous to a relational "join" in XML?

For example, let's say I have an XML file that has a root element of 
departments. Each record of the file has information about a single 
department in a company and consists of a department number, department 
name, manager name, and location. Let's say I have another XML file that 
lists employees. Each record is an employee and gives information about the 
employee's name, date of birth, department number, home address, etc.

Given that these are two separate XML files but that there is some common 
information, specifically the department number, could I use XSLT to 
generate a report that shows me each department name followed by the names 
of the people who work in the department? Something like this:

Marketing
    Department Number: 001
    Location: New York
    Manager: T. Jones

    Other Staff
    E. Humperdinck
    E. Presley
    J. Hendrix

Information Systems
    Department Number: 666
    Location: Toronto
    Manager: M. Slate

    Other Staff
    F. Flintstone
    B. Rubble
    J. Rockhead

In other words, we're getting the department name and manager name from the 
departments file and the "other staff" names from the employees file. We 
know which employees go in which departments because the department number 
is in both the departments file and in the employees file.

Is it conceptually possible to do this kind of joining in XSLT? If so, what 
is this called? In other words, what are the main terms I need to know here? 
I'd call this a join in relational database terminology but I imagine XSLT 
has different terminology.

If this IS possible, can someone point me to a tutorial or reference that 
explains how to write XSLT to do this?

--
Rhino 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent