Hi,

I am using saxon6.4.3 on Solaris.  I've been trying to understand the != and = operator for comparing node set to node set and reading Michael's book.  I cannot conclude my understanding.  How can make a 'deep' comparison such that two single nodes and its own children can be compared?   Thus, any string value differences from the attributes and element nodes within the tree can return true.  I really appreciate the help.

I capture sNode below from one file and cNode from another file.

sNode:

<xyz name="xyz">
   <vwx name="vwx1">
      <tuv>tuv text</tuv>
   </vwx>
   <vwx name="vwx2"/>
</xyz>

cNode:

<xyz name="xyz">
   <vwx name="vwx1">
      <tuv>tuv text</tuv>
   </vwx>
   <vwx name="vwx2"/>
</xyz>

Here is the dtd
<!ELEMENT XYZ (xyz*)>

<!ELEMENT xyz (vwx*)>
<!ATTLIST xyz name ID #REQUIRED>

<!ELEMENT vwx (tuv?)>
<!ATTLIST vwx name ID #REQUIRED>

<!ELEMENT tuv (#PCDATA)>

Here is the XSLT

<xsl:template match="XYZ">
  <xsl:for-each select="document('test2.xml')/XYZ/xyz">
    <xsl:apply-templates select="current()" mode="two">
      <xsl:with-param name="cNode" select="current()"/>
    </xsl:apply-templates>
  </xsl:for-each>
</xsl:template>

<xsl:template match="xyz" mode="two">
  <xsl:param name="cNode"/>
  <xsl:text>xyz two:</xsl:text>
  <xsl:apply-templates select="document('test1.xml')/XYZ" mode="one">
    <xsl:with-param name="cNode" select="$cNode"/>
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="XYZ" mode="one">
  <xsl:param name="cNode"/>
  <xsl:text>&#xA;&#xA;sNode&#xA;&#xA;</xsl:text>
  <xsl:copy-of select="current()/xyz"/>

  <xsl:text>&#xA;&#xA;cNode&#xA;&#xA;</xsl:text>
  <xsl:copy-of select="$cNode"/>

  <xsl:text>&#xA;&#xA;TEST !=&#xA;&#xA;</xsl:text>
  <xsl:if test="($cNode != id($cNode/*/@name))">
    <xsl:text>Fall In</xsl:text>
  </xsl:if>
</xsl:template>