RE: [xsl] template match based on external document

Subject: RE: [xsl] template match based on external document
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 23 Aug 2006 10:13:15 +0100
> I know this code is wrong but it illustrates my thinking at 
> the moment:
> ---
> <xsl:template match="g[@id=document('doc.xml')//object@id]">

Change it to

<xsl:template match="g[@id=document('doc.xml')//object/@id]">

and it's fine (though probably slow).

>   <xsl:value-of select="document('doc.xml')//object@type"/>

That should probably be something like

 <xsl:value-of
select="document('doc.xml')//object[@id=current()/@id]/@type"/>

But you may be better off using keys.

Michael Kay
http://www.saxonica.com/

Current Thread