Greetings,

I'm having an extremely frustrating time trying to compare two xml elements using the following command:

<xsl:if test="ThisThing[. = ThisOtherThing]">do this</xsl:if>

Heck, it won't even work if I try ThisThing[. = ThisThing]. The only way I can get this to work is if I acutally compare "ThisThing" to a string ( ThisThing[. = '12345'] ).

Here's an example:

*********** EXAMPLE XML ********************

<?xml version="1.0"?>
<portfolio xmlns:dt="urn:schemas-microsoft-com:datatypes">
  <bestReturn>ZCXM</bestReturn>
  <stock exchange="nyse">
    <name>zacx corp</name>
    <symbol>ZCXM</symbol>
    <price dt:dt="number">28.875</price>
  </stock>
  <stock exchange="nasdaq">
    <name>zaffymat inc</name>
    <symbol>ZFFX</symbol>
    <price dt:dt="number">92.250</price>
  </stock>
  <stock exchange="nasdaq">
    <name>zysmergy inc</name>
    <symbol>ZYSZ</symbol>
    <price dt:dt="number">20.313</price>
  </stock>
</portfolio>

*********** EXAMPLE XSL ********************

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" result-ns="http://www.w3.org/TR/REC-html">
  <xsl:template match="/">
    <HTML>
      <BODY>
	<B>Best Historical Return: </B><xsl:value-of select="portfolio/bestReturn"/>
	<BR/><BR/>
	<B><I>My Portfolio</I></B><BR/>
        <TABLE BORDER="2">
          <TR>
            <TD><B>Symbol</B></TD>
            <TD><B>Name</B></TD>
            <TD><B>Price</B></TD>
            <TD><B>Best Return</B></TD>
          </TR>
          <xsl:for-each select="portfolio/stock">
            <TR>
              <TD><xsl:value-of select="symbol"/></TD>
              <TD><xsl:value-of select="name"/></TD>
              <TD><xsl:value-of select="price"/></TD>
              <TD>

<!-- HERE'S MY PROBLEM -->

		<xsl:if test="symbol[. = ../bestReturn]">Yes</xsl:if>

<!-- THE EXAMPLE BELOW WORKS, BUT IT'S COMPARING TO A STRING RATHER THAN ANOTHER ELEMENT-->

		<xsl:if test="symbol[not(. = 'ZCXM')]">No</xsl:if>
	      </TD>
            </TR>
          </xsl:for-each>
        </TABLE>
      </BODY>
    </HTML>
  </xsl:template>
</xsl:stylesheet>

******************************************

What am I doing wrong?  Please help me, for sanity's sake.

--Mark