Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - A little XSL help please? >Thread Next - Re: A little XSL help please? Re: A little XSL help please?To: NULL Date: 5/1/2008 6:12:00 PM
Dennis wrote:
> [[Sorry I couldn't think of a better subject for this rookie question.]]
>
> In my .xml I have something like:
>
> <root>
> <parent>
> ...
> <child>
> <keynode>thekey</keynode>
> </child>
> </parent>
> ...
> <parent>
> <keynode>thekey</keynode>
> <valuenode>thevalue</valuenode>
> ...
> </parent>
> </root>
>
> In english, what I would like to do in my .xsl is this:
>
> When processing each /root/parent/child, use the value of keynode
> ('thekey') to look up a /root/parent somewhere else in the .xml with a
> keynode which matches ... and retrieve the corresponding valuenode
> ('thevalue').
>
> Is this possible?
Sure
<xsl:template match="root/parent/child">
<xsl:value-of select="../parent[keynode =
current()/keynode]/valuenode"/>
</xsl:template>
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
