xsl-list
[Top] [All Lists]

[xsl] Having Trouble With Condition For Default Nodeset Selection

2006-07-04 16:51:26
Hi Folks,

I am trying to look up a country code in a list of supported currencies, with a default to US if it is not found. I am using the XSLT 1.0 idiom of

nodeset1[condition] | nodeset2[not(condition)]

for a mutually exclusive result, however for the life of me I can't seem to find a suitable condition - I probably just need a figurative whack on the side of the head to help me "think different" (or should that be "differently?"). I have tried several different variations of the following with no luck, though I am probably just overlooking something really obvious:

<xsl:variable name="currency" select="$currency-data//currency[(_at_)code=$country-code and @code != 'US'] | $currency-data//currency[not(@code=$country-code and @code != 'US')]" />

Nothing seems to work no matter how I arrange that - the US currency is always unioned into the set. I'm sure that's the wrong condition to use, and there is something relatively simple I can add, but I'm just not seeing it.

Does anyone have any suggestions, or perhaps a nerf mallet?

Thanks in advance

--
Duncan Anker
Server 101, Web Hosting & E-Commerce
http://www.server101.com


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--