xsl-list
[Top] [All Lists]

RE: [xsl] template match based on external document

2006-08-24 20:07:40
Many thanks - works a treat!

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: Wednesday, August 23, 2006 5:13 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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[(_at_)id=document('doc.xml')//object(_at_)id]">

Change it to

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

and it's fine (though probably slow).

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

That should probably be something like

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

But you may be better off using keys.

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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>