diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2008-09-17 21:50:18 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2008-09-17 21:50:18 +0400 |
commit | a3f31057d18c155e0f9aac6e64ee454f435d7d1e (patch) | |
tree | 4ee3f5398b97be3d52be8685afc3fa1f7229836e /mcs/class/System.XML/Mono.Xml | |
parent | 65c1c732c96fb6d3653ac97137a6d042926ab784 (diff) |
2008-09-17 Atsushi Enomoto <atsushi@ximian.com>
* SubtreeXmlReader.cs : Close() should correctly skip empty element.
In Read(), make sure to move from Element state.
* XmlReader.cs : detailed error location in ReadSubtree().
* XmlReaderCommonTests.cs : another Subtree+EmptyElement case.
svn path=/trunk/mcs/; revision=113339
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml')
-rw-r--r-- | mcs/class/System.XML/Mono.Xml/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/Mono.Xml/SubtreeXmlReader.cs | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/mcs/class/System.XML/Mono.Xml/ChangeLog b/mcs/class/System.XML/Mono.Xml/ChangeLog index 75f75d746b7..e544d1f5aa0 100644 --- a/mcs/class/System.XML/Mono.Xml/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml/ChangeLog @@ -1,5 +1,10 @@ 2008-09-17 Atsushi Enomoto <atsushi@ximian.com> + * SubtreeXmlReader.cs : Close() should correctly skip empty element. + In Read(), make sure to move from Element state. + +2008-09-17 Atsushi Enomoto <atsushi@ximian.com> + * SubtreeXmlReader.cs : make sure to set eof for empty element after Read(). diff --git a/mcs/class/System.XML/Mono.Xml/SubtreeXmlReader.cs b/mcs/class/System.XML/Mono.Xml/SubtreeXmlReader.cs index 0a6adc3a183..0e4238f839a 100644 --- a/mcs/class/System.XML/Mono.Xml/SubtreeXmlReader.cs +++ b/mcs/class/System.XML/Mono.Xml/SubtreeXmlReader.cs @@ -142,7 +142,7 @@ namespace Mono.Xml public override void Close () { - while (Reader.Depth > startDepth && Read ()) + while (Read ()) ; } @@ -221,11 +221,13 @@ namespace Mono.Xml } if (!read) { read = true; + Reader.MoveToElement (); bool ret = !Reader.IsEmptyElement && Reader.Read (); if (!ret) eof = true; return ret; } + Reader.MoveToElement (); if (Reader.Depth > startDepth) if (Reader.Read ()) return true; |