Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how would you use a 2nd xml with xsl:key as a lookup

Status
Not open for further replies.

mountainbiker

Programmer
Aug 21, 2002
122
GB
xml 1
Code:
<AAA>
    <BBB>this is a test</BBB>
    <Country>GBR</Country>
    <CCC>A real small test</CCC>
</AAA>

xml 2 (the look up table)
Code:
<CountryLookup>
	<Country ISO-2=&quot;GB&quot; ISO-3=&quot;GBR&quot;>United Kingdom</Country>
	<Country ISO-2=&quot;US&quot; ISO-3=&quot;USA&quot;>United States of America</Country>
.
.
.
</CountryLookup>

xslt
Normally in the translation, I would use some sort of <xsl:choose> case statement to do this big long comparison; however, is it possible to pull in xml 2 (the lookup table maybe using document() and then use xsl:ksy to extract/match for the data needed?

-OR-

Is it better to do it like this example
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top