You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mm...@apache.org on 2002/11/05 22:40:12 UTC
cvs commit: xml-xalan/java/src/org/apache/xpath/functions FuncDeepEqual.java
mmidy 2002/11/05 13:40:12
Modified: java/src/org/apache/xpath/functions Tag: xslt20
FuncDeepEqual.java
Log:
Fix some problems with deep-equal
Revision Changes Path
No revision
No revision
1.1.2.2 +18 -1 xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncDeepEqual.java
Index: FuncDeepEqual.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncDeepEqual.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- FuncDeepEqual.java 17 Oct 2002 20:11:02 -0000 1.1.2.1
+++ FuncDeepEqual.java 5 Nov 2002 21:40:12 -0000 1.1.2.2
@@ -168,6 +168,7 @@
case DTM.TEXT_NODE:
case DTM.NAMESPACE_NODE:
case DTM.PROCESSING_INSTRUCTION_NODE:
+ case DTM.ATTRIBUTE_NODE:
if (collator != null)
{
if (collator.equals(dtm1.getNodeValue(node1), dtm2.getNodeValue(node2)))
@@ -187,6 +188,10 @@
{
int attrNode1 = dtm1.getFirstAttribute(node1);
int attrNode2 = dtm2.getFirstAttribute(node2);
+
+ if ((attrNode1 == DTM.NULL || attrNode2 == DTM.NULL) && attrNode2 != attrNode1)
+ return false;
+
while (attrNode1 != DTM.NULL && attrNode2 != DTM.NULL)
{
attrNode2 = dtm2.getAttributeNode(node2, dtm1.getNamespaceURI(attrNode1), dtm1.getNodeName(attrNode1));
@@ -202,7 +207,19 @@
break;
}
if (attrNode1 != DTM.NULL)
- return false;
+ return false;
+ else
+ {
+ attrNode2 = dtm2.getFirstAttribute(node2);
+ while (attrNode2 != DTM.NULL)
+ {
+ if(DTM.NULL == dtm2.getAttributeNode(node1, dtm2.getNamespaceURI(attrNode2), dtm2.getNodeName(attrNode2)))
+ return false;
+ else
+ attrNode2 = dtm2.getNextAttribute(attrNode2);
+ }
+ }
+
if (dtm1.hasChildNodes(node1) && dtm2.hasChildNodes(node2))
{
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org