[xsl] Comparing One element's text to multiple elements' text

Subject: [xsl] Comparing One element's text to multiple elements' text
From: "Daniel Joshua" <daniel.joshua@xxxxxxxxxxxx>
Date: Fri, 7 May 2004 11:48:56 +0800
Hi,

I would like to compare one element's text value to a group of multiple
elements' text values. I tried, but I think I am not comparing the text
portion correctly.

Simplified XML:

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<root>
  <value1>ABC</value1>
  <value2>
    <option>ABC</option>
    <option>DEF</option>
    <option>HIJ</option>
  </value2>
</root>

Simplified XSL:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

  <xsl:template match="/">
    <xsl:if test="value1 = value2/option[*]">
      <xsl:text>true</xsl:text>
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>


Regards,
Daniel

Current Thread