XSL:Choose with CDATA

XSL:Choose with CDATA

Post by Mart » Wed, 11 Jul 2001 04:04:20



Does anyone have any idea why the xsl:when statement below will not
equate to true when the countries are "US"?  Is it because the
Page/ApplicationData/Person/Address/country is wrapped in CDATA?

<SELECT NAME="country">
<xsl:for-each select="../ApplicationData/Country">
<xsl:choose>
<xsl:when test=" value = ../ApplicationData/Person/Address/country ">
<OPTION SELECTED="{value}"><xsl:value-of select="name"/></OPTION >
</xsl:when>
<xsl:otherwise>
<OPTION VALUE="{value}"><xsl:value-of select="name"/></OPTION >
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</SELECT>

<Page>
<PresentationData>
</PresentationData>
<ApplicationData>
<Person>
      <name><![CDATA[Testname]]></name>
<Address>
      <addressLine3/>
      <addressLine2/>
      <addressLine1><![CDATA[address 1]]></addressLine1>
      <state><![CDATA[NY]]></state>
      <postalCode><![CDATA[123456]]></postalCode>
      <city><![CDATA[Some city]]></city>
      <country><![CDATA[US]]></country>
</Address>
</Person>

<Country>
      <value>US</value>
      <name>United States</name>
</Country>
<Country>
      <value>MX</value>
      <name>Mexico</name>
</Country>
<Country>
      <value>CA</value>
      <name>Canada</name>
</Country>
</ApplicationData>
</Page>