From 77766f3b356281767a1e0a3462ec77e71db61d1f Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sat, 8 Jun 2002 02:00:46 +0000 Subject: * MoveToAttribute should stop on the requested attribute and return true, otherwise return false. svn path=/trunk/mcs/; revision=5168 --- mcs/class/System.XML/System.Xml/XmlTextReader.cs | 25 +++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'mcs/class/System.XML/System.Xml') 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] -- cgit v1.2.3