diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2008-03-17 12:38:02 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2008-03-17 12:38:02 +0300 |
commit | e874b958bf0d59632868b213f1c2af3aa056967a (patch) | |
tree | 6096e6cfe4098629255e5b60299d094721ac2ca4 /mcs/class/System.XML/Mono.Xml.XPath | |
parent | 8b32aee19e494236faa2ac02f7332590458a0820 (diff) |
2008-03-17 Atsushi Enomoto <atsushi@ximian.com>
* DTMXPathDocumentBuilder2.cs : allow document fragment as XmlReader
input. Fixed bug #324606.
* XPathNavigatorTests.cs : added test for bug #324606.
svn path=/trunk/mcs/; revision=98446
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.XPath')
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.XPath/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog index 079b62dcbe8..17694171565 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog @@ -1,3 +1,8 @@ +2008-03-17 Atsushi Enomoto <atsushi@ximian.com> + + * DTMXPathDocumentBuilder2.cs : allow document fragment as XmlReader + input. Fixed bug #324606. + 2007-07-02 Atsushi Enomoto <atsushi@ximian.com> * DTMXPathDocumentBuilder2.cs : do not bork at non-document element diff --git a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs index c5be1e09de3..127652103d6 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs +++ b/mcs/class/System.XML/Mono.Xml.XPath/DTMXPathDocumentBuilder2.cs @@ -183,9 +183,12 @@ namespace Mono.Xml.XPath this.lastNsInScope = 1; parentStack [0] = nodeIndex; - // LAMESPEC: it should not read more than one top-level element, but .NET sucks here. See bug #81932 - while (!xmlReader.EOF && parentStackIndex >= 0) + if (xmlReader.ReadState == ReadState.Initial) + xmlReader.Read (); + int startDepth = xmlReader.Depth; + do { Read (); + } while (skipRead || xmlReader.Read () && xmlReader.Depth >= startDepth); SetNodeArrayLength (nodeIndex + 1); SetAttributeArrayLength (attributeIndex + 1); SetNsArrayLength (nsIndex + 1); @@ -203,10 +206,8 @@ namespace Mono.Xml.XPath public void Read () { - if (!skipRead) - if (!xmlReader.Read ()) - return; skipRead = false; + int parent = parentStack [parentStackIndex]; int prevSibling = nodeIndex; |