diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2006-09-01 20:31:06 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2006-09-01 20:31:06 +0400 |
commit | cde8954e440b91633cd279e6e827c042eed95411 (patch) | |
tree | 1999d85890482ec203a68accfb41a953cbcb57f7 /mcs/class/System.XML/Mono.Xml.XPath | |
parent | 9ff7a22c3713a1efde945c9febf6fc577524d765 (diff) |
2006-09-01 Atsushi Enomoto <atsushi@ximian.com>
* XPathNavigatorReader.cs : MoveToFirstAttribute() should return
true when current node is an attribute (including namespace node).
* XPathNavigatorReaderTests.cs : added test for MoveToFirstAttribute()
which is called from several current nodes.
svn path=/trunk/mcs/; revision=64720
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/XPathNavigatorReader.cs | 23 |
2 files changed, 17 insertions, 11 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog index 542e2887925..c13c5d2f935 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml.XPath/ChangeLog @@ -1,3 +1,8 @@ +2006-09-01 Atsushi Enomoto <atsushi@ximian.com> + + * XPathNavigatorReader.cs : MoveToFirstAttribute() should return + true when current node is an attribute (including namespace node). + 2006-08-28 Atsushi Enomoto <atsushi@ximian.com> * DTMXPathDocumentWriter2.cs : use String.Empty instead of null for diff --git a/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs b/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs index ad07c82d892..b02039c4656 100644 --- a/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs +++ b/mcs/class/System.XML/Mono.Xml.XPath/XPathNavigatorReader.cs @@ -454,19 +454,20 @@ namespace Mono.Xml.XPath return false;
}
- /*
- public override void MoveToAttribute (int i)
- {
- if (!MoveToAttributeNavigator (i))
- throw new ArgumentOutOfRangeException ();
- }
- */
-
public override bool MoveToFirstAttribute ()
{
- if (CheckAttributeMove (current.MoveToFirstNamespace (XPathNamespaceScope.Local)))
- return true;
- return CheckAttributeMove (current.MoveToFirstAttribute ());
+ switch (current.NodeType) {
+ case XPathNodeType.Element:
+ if (CheckAttributeMove (current.MoveToFirstNamespace (XPathNamespaceScope.Local)))
+ return true;
+ return CheckAttributeMove (current.MoveToFirstAttribute ());
+ case XPathNodeType.Namespace:
+ case XPathNodeType.Attribute:
+ current.MoveToParent ();
+ goto case XPathNodeType.Element;
+ default:
+ return false;
+ }
}
public override bool MoveToNextAttribute ()
|