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:
authorAdam Treat <adam@mono-cvs.ximian.com>2002-06-08 06:00:46 +0400
committerAdam Treat <adam@mono-cvs.ximian.com>2002-06-08 06:00:46 +0400
commit77766f3b356281767a1e0a3462ec77e71db61d1f (patch)
treee14fbb9098d1e0bc16559bfcb4ccaac1b0f9aa24 /mcs/class/System.XML/System.Xml
parent83eb4b25df1573717866a36eb7da9b81e1fbbb14 (diff)
* MoveToAttribute should stop on the requested attribute and return true,
otherwise return false. svn path=/trunk/mcs/; revision=5168
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextReader.cs25
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]