Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2007-01-05 23:14:32 +0300
committerAtsushi Eno <atsushieno@gmail.com>2007-01-05 23:14:32 +0300
commit73355f18459a95b405846a4cdc400eb047866ba1 (patch)
treeea537592071bfcaa6ef75a6fb1860bed117af04c /mcs/class/System.XML/Mono.Xml.XPath
parentda62dc69f067c379049532c8d9a4499a875c12a1 (diff)
2007-01-05 Atsushi Enomoto <atsushi@ximian.com>
* DTMXPathDocumentBuilder2.cs : fixed incorrect namespace node links which happened to following siblings of a node with namespaces. * XPathNavigatorCommonTests.cs : added test for incorrect namespace node links. svn path=/trunk/mcs/; revision=70557
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.XPath')
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/ChangeLog5
-rw-r--r--mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs8
2 files changed, 12 insertions, 1 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
index ee3ffbabb02..808d0559073 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
+++ b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DTMXPathDocumentBuilder2.cs : fixed incorrect namespace node links
+ which happened to following siblings of a node with namespaces.
+
2006-12-05 Atsushi Enomoto <atsushi@ximian.com>
* XPathEditableDocument.cs : those writers should lookup prefix when
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs
index 3c42eb99282..9093e3a479c 100644
--- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs
+++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs
@@ -235,6 +235,8 @@ namespace Mono.Xml.XPath
else
goto default;
case XmlNodeType.EndElement:
+ int endedNode = parentStack [parentStackIndex];
+ AdjustLastNsInScope (endedNode);
parentStackIndex--;
return;
default:
@@ -341,8 +343,12 @@ namespace Mono.Xml.XPath
hasLocalNs = false;
attrIndexAtStart = attributeIndex;
nsIndexAtStart = nsIndex;
+ AdjustLastNsInScope (previousSibling);
+ }
- while (namespaces [lastNsInScope].DeclaredElement == previousSibling) {
+ private void AdjustLastNsInScope (int target)
+ {
+ while (namespaces [lastNsInScope].DeclaredElement == target) {
lastNsInScope = namespaces [lastNsInScope].NextNamespace;
}
}