[xsl] Reverse lookup table

Subject: [xsl] Reverse lookup table
From: "Dunning, John" <JDunning@xxxxxxxxx>
Date: Tue, 9 Jul 2002 15:30:46 -0400
Hi all,

I'm posting this as a follow-up to a post I made a couple weeks ago
(changing scope in for-each) which I guess could have been phrased more
clearly.  What I'm trying to accomplish is a 'reverse' lookup table; that
is, if something is *not* in the document, have the stylesheet supply the
boilerplate text.  If the answer is indeed a FAQ, please forgive my
thickness and please help clarify.

The problem in all my attempted solutions is that once I start looping
through the lookup table my scope shifts from the XML document to the
stylesheet.  The logic I'm using is:
+ get the organization from the XML doc (AP)
+ find that organization in the lookup table
+ loop through the countries that make up that organization in the lookup
table comparing them to the XML document (this step is where the problem

Again, any and all help is appreciated.  Thanks, John

<!-- INPUT XML -->
   <!-- note country 'GH' missing; note also that countries that make up a
        are not contained, but follow -->

<!-- lookup table -->
	<LU:organization name="AP">
		<LU:state name="GH"/>
		<LU:state name="GM"/>
		<LU:state name="KE"/>
		<LU:state name="LS"/>
		<LU:state name="MW"/>
		<LU:state name="MZ"/>
		<LU:state name="SD"/>
		<LU:state name="SL"/>
		<LU:state name="SZ"/>
		<LU:state name="TZ"/>
		<LU:state name="UG"/>
		<LU:state name="ZM"/>
		<LU:state name="ZW"/>

<!-- desired output -->
Organization: AP: GM KE LS MW MZ SD SL SZ TZ UG ZM ZW (except GH)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread