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]

RE: merging two documents - only if second document matches


> I have two documents, file A and file B.  I want to join them 
> on the id of
> the first, but only if a matching id is in the 2nd.  How do I do this?
> 
> File A              File B               Desired Output
> <id> A </id>        <id> A </id>         <id> A </id>
> <id> B </id>        <id> C </id>         <id> D </id>
> <id> D </id>        <id> D </id>
> 

<xsl:copy-of select="document('a.xml')//id[.=document('b.xml')//id]"/>

Mike Kay

 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]