rowan(_at_)sylvester-bradley(_dot_)org wrote:
<xsl:template match="item[string-length(ref)>0]">
<xsl:variable name="ref" select="ref"/>
<xsl:copy-of select="//items/item[name=$ref]"/>
</xsl:template>
But why do I need the variable? What do I have to write in the predicate to
compare the value of the name element in items as I search the file in the
copy-of with the ref element in the current node?
You can use current() e.g.
<xsl:copy-of select="//items/item[name = current()/ref]"/>
You should however define a key e.g.
<xsl:key name="k1" match="item" use="name"/>
and then do
<xsl:copy-of select="key('k1', ref)"/>
--
Martin Honnen
http://msmvps.com/blogs/martin_honnen/
--~------------------------------------------------------------------
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>
--~--