RE: [xsl] template match based on external document

Subject: RE: [xsl] template match based on external document
From: "Lincoln" <lincoln.mitchell@xxxxxxxxxx>
Date: Fri, 25 Aug 2006 11:07:09 +0800
Many thanks - works a treat!

> -----Original Message-----
> From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
> Sent: Wednesday, August 23, 2006 5:13 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] template match based on external document
> 
> > 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