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

Merging multiple documents efficiently

Subject: Merging multiple documents efficiently
From: mjyoungblut@xxxxxxx
Date: Fri, 2 Feb 2001 14:36:14 -0600
merging multiple documents
I have multiple documents, files A, B, and C.  I want to join them on the
id of the first, but only if a matching id is in the 2nd or 3rd.  How do I
do this?

NOTE: File A is my source file.  I call document( ) to match against B and
C
Example:
File A              File B               File C              Desired Output
<id>A</id>          <id>A</id>           <id>B</id>          <id>A</id>
<id>B</id>          <id>D</id>           <id>D</id>          <id>B</id>
<id>D</id>                                         <id>D</id>
<id>D</id>
<id>E</id>

Here is (part of) my existing code.  It generally works, but is quite
inefficient for large input files.

<xsl:template match="Hierarchy">
     <xsl:for-each select="NodeID[. = $PRD/ListofProducts/Product/NodeID]|
                      NodeID[. = $HRY/Hierarchies/Hierarchy/NodeID]|
                      NodeID[. = $MSD/MDSDs/MSDS/NodeID]">
          <xsl:for-each select="..">
               // Perform matching based on NodeID
               ...
          </xsl:for-each>
     </xsl:for-each>
</xsl:template>

Thanks,
     Matt Youngblut


 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.