Subject: RE: compare two lists of values question
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 8 Aug 2001 09:30:27 +0100
|
> I'm assuming this is kind of a novice level question.
> I need to compare two lists of values and display the value
> of any name
> element not in both lists.
With Merchants as the context node:
<xsl:variable name="us" select="USMerchants/name"/>
<xsl:variable name="uk" select="UKMerchants/name"/>
<xsl:for-each select="$us[not(.=$uk)] | $uk[not(.=$us)]">
<xsl:value-of select="."/>;
</xsl:for-each>
Mike Kay
Software AG
> The xml is like this:
> <Merchants>
> <USMerchants>
> <name>store1</name>
> <name>store2</name>
> <name>store3</name>
> <name>store4</name>
> <name>store5</name>
> <name>store6</name>
> </USMerchants>
> <UKMerchant>
> <name>store1</name>
> <name>store2</name>
> <name>store3</name>
> <name>store4</name>
> <name>store5</name>
> <name>store99</name>
> </UKMerchant>
> </Merchants>
>
> Using MSXML3 parser.
>
> Thanks in advance,
> Hal Friedlander
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|