This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: merging two documents - only if second document matches
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] merging two documents - only if second document matches
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Fri, 2 Feb 2001 09:25:47 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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