RE: [xsl] Referencing a lookup table

Subject: RE: [xsl] Referencing a lookup table
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 12 Jul 2004 10:02:29 +0100
If the context node is a <cover> element, you can reference the <desc> of
the corresponding <fund> element as

../../funds/fund[@code=current()/@fundcode]/desc

Michael Kay

P.S. It's better to think in terms of elements as nodes on a tree, not as
tags. Every element in XML has two tags, a start tag and an end tag, unless
it is written in the short form <a/>, in which case it only has a single
tag. XSLT processes nodes, not tags.

> -----Original Message-----
> From: Sips, Gregor [mailto:G.Sips@xxxxxxxxxxxxxxx]
> Sent: 12 July 2004 08:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Referencing a lookup table
>
> Hi !
>
> I am relatively new in the world of XML and XSL, so my
> problem has probably been adressed before. I have been
> looking in the archive but couldn't find any solution.
> Well, the point is that I have some XML-tags added to an
> original XML message. The result looks like this:
>
> <document>
>    <!-- original tags -->
>    <policy>
>       <cover>
>          <fundcode>1</fundcode>
>          <amount>120</amount>
>          <some_other_stuff/>
>       </cover>
>       <cover>
>          <fundcode>2</fundcode>
>          <amount>80</amount>
>          <some_other_stuff/>
>       </cover>
>    </policy>
>    <!-- addes tags -->
>    <funds>
>       <fund>
>          <code>1</code>
>          <desc>Fund 1</desc>
>       </fund>
>       <fund>
>          <code>2</code>
>          <desc>Fund 2</desc>
>       </fund>
>    </funds>
> </document>
>
> I want te create a XHTML where I select form the cover node
> the funds including the corresponding description in the
> added tags section.
> I have been struggling with all kinds of combinations of
> value-of and for-each elements but so far no result. Is there
> anybody who can help me ?
>
> Kind regards,
> Gregor Sips
> De in dit e-mailbericht verstrekte informatie (inclusief
> attachments) is vertrouwelijk en uitsluitend bestemd voor de
> geadresseerde. Het gebruik door derden of het verstrekken aan
> derden van deze informatie dan wel kopikren van deze
> informatie is niet toegestaan.
> Vanwege de elektronische verzending kunnen er geen rechten
> worden ontleend aan de informatie in dit bericht.
> Dit e-mailbericht is gecontroleerd op aanwezigheid van
> computervirussen.
>
>
> The information provided in this e-mailmessage (including
> attachments) is confidential and intended solely for the
> adressee. The use by third-parties or the providing to
> third-parties of this information or the copying of this
> information is not allowed.
> Because of the electronic sending no rights can be derived
> from the information in this message.
> This e-mailmessage has been checked for the presence of
> computer viruses.

Current Thread