This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Merging multiple documents efficiently


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]