diff options
author | Adam Treat <adam@mono-cvs.ximian.com> | 2002-06-08 06:00:46 +0400 |
---|---|---|
committer | Adam Treat <adam@mono-cvs.ximian.com> | 2002-06-08 06:00:46 +0400 |
commit | 77766f3b356281767a1e0a3462ec77e71db61d1f (patch) | |
tree | e14fbb9098d1e0bc16559bfcb4ccaac1b0f9aa24 /mcs | |
parent | 83eb4b25df1573717866a36eb7da9b81e1fbbb14 (diff) |
* MoveToAttribute should stop on the requested attribute and return true,
otherwise return false.
svn path=/trunk/mcs/; revision=5168
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System.XML/System.Xml/XmlTextReader.cs | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlTextReader.cs b/mcs/class/System.XML/System.Xml/XmlTextReader.cs index 271ce5281d3..05d47909c81 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextReader.cs @@ -374,6 +374,7 @@ namespace System.Xml public override bool MoveToAttribute (string name) { MoveToElement (); + bool match = false; if (attributes == null) return false; @@ -385,18 +386,24 @@ namespace System.Xml while (orderedAttributesEnumerator.MoveNext ()) { if(name == orderedAttributesEnumerator.Current as string) { - string value = attributes [name] as string; - SetProperties ( - XmlNodeType.Attribute, // nodeType - name, // name - false, // isEmptyElement - value, // value - false // clearAttributes - ); + match = true; + break; } } - return false; + if (match) { + + string value = attributes [name] as string; + SetProperties ( + XmlNodeType.Attribute, // nodeType + name, // name + false, // isEmptyElement + value, // value + false // clearAttributes + ); + } + + return match; } [MonoTODO] |