Author: atsushi
Date: 2005-03-15 16:24:18 -0500 (Tue, 15 Mar 2005)
New Revision: 41861
Modified:
trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog
trunk/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
trunk/mcs/class/System.XML/System.Xml/ChangeLog
trunk/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
Log:
2004-03-15 Atsushi Enomoto <[EMAIL PROTECTED]>
* XPathNavigator.cs : In ComparePosition(), make use of IsDescendant().
* XmlDocumentNavigator.cs : overriden IsDescendant (default
implementation extraneously clones).
Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog 2005-03-15 21:15:37 UTC
(rev 41860)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog 2005-03-15 21:24:18 UTC
(rev 41861)
@@ -1,5 +1,10 @@
2005-03-15 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * XmlDocumentNavigator.cs : overriden IsDescendant (default
+ implementation extraneously clones).
+
+2005-03-15 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* DTDValidatingReader.cs : When expanding entities and there is a
sequence of text nodes, its value was not returned.
* XmlTextReader.cs : better invalid char error report for EOF.
Modified: trunk/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
2005-03-15 21:15:37 UTC (rev 41860)
+++ trunk/mcs/class/System.XML/System.Xml/XmlDocumentNavigator.cs
2005-03-15 21:24:18 UTC (rev 41861)
@@ -301,7 +301,24 @@
// returns actual namespace for the other nodes.
return Node.GetNamespaceOfPrefix (name);
}
-
+
+ public override bool IsDescendant (XPathNavigator other)
+ {
+ if (NsNode != null)
+ return false;
+ XmlDocumentNavigator o = other as XmlDocumentNavigator;
+ if (o == null)
+ return false;
+ XmlNode n =
+ o.node.NodeType == XmlNodeType.Attribute ?
+ ((XmlAttribute) o.node).OwnerElement :
+ o.node.ParentNode;
+ for (;n != null; n = n.ParentNode)
+ if (n == node)
+ return true;
+ return false;
+ }
+
public override bool IsSamePosition (XPathNavigator other)
{
XmlDocumentNavigator otherDocumentNavigator = other as
XmlDocumentNavigator;
Modified: trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog 2005-03-15
21:15:37 UTC (rev 41860)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/ChangeLog 2005-03-15
21:24:18 UTC (rev 41861)
@@ -1,3 +1,7 @@
+2004-03-15 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * XPathNavigator.cs : In ComparePosition(), make use of IsDescendant().
+
2004-03-14 Atsushi Enomoto <[EMAIL PROTECTED]>
* Expression.cs,
Modified: trunk/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
2005-03-15 21:15:37 UTC (rev 41860)
+++ trunk/mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
2005-03-15 21:24:18 UTC (rev 41861)
@@ -142,6 +142,9 @@
if (IsSamePosition (nav))
return XmlNodeOrder.Same;
+ if (IsDescendant (nav))
+ return XmlNodeOrder.Before;
+
XPathNavigator nav1 = Clone ();
XPathNavigator nav2 = nav.Clone ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches