Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Build up xpath dynamically in xslt [Thread Next] Re: Build up xpath dynamically in xsltTo: NULL Date: 6/4/2004 11:59:00 AM Hi Joe,
There is an easier way.
Use <xsl:key> to build an index of all the image nodes based on
uniquereferenceid. Then use the key() function to return the image
nodes that match the uniquereferenceid of the property node.
Something like this:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="images" match="/web_transfer/images"
use="uniquereferenceid"/>
<xsl:template match="/">
<xsl:for-each select="web_transfer/property">
<image1>
<xsl:value-of
select="key('images',uniquereferenceid)[position()=1]/imageurl"/>
</image1>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--
Jesse Hager
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
