RE: [xsl] merging two documents - only if second document matches

Subject: RE: [xsl] merging two documents - only if second document matches
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 2 Feb 2001 09:25:47 -0000
> 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


Current Thread