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:
authorAtsushi Eno <atsushieno@gmail.com>2008-09-19 14:46:48 +0400
committerAtsushi Eno <atsushieno@gmail.com>2008-09-19 14:46:48 +0400
commit5a15db1e4c2e9cf62148dbb3ef30da953cefc25a (patch)
treef884fa5aa7a3b299283b5813876e07aeec4da40a /mcs/class/System.XML/System.Xml.XPath
parentecf1894b4b665d60c550c37e12dbcfd582d74eca (diff)
2008-09-19 Atsushi Enomoto <atsushi@ximian.com>
* DefaultContext.cs, Expression.cs: do not premise BaseIterator. svn path=/trunk/mcs/; revision=113511
Diffstat (limited to 'mcs/class/System.XML/System.Xml.XPath')
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/ChangeLog4
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs8
-rw-r--r--mcs/class/System.XML/System.Xml.XPath/Expression.cs10
3 files changed, 15 insertions, 7 deletions
diff --git a/mcs/class/System.XML/System.Xml.XPath/ChangeLog b/mcs/class/System.XML/System.Xml.XPath/ChangeLog
index 8846d2114fc..65e1b1cca97 100644
--- a/mcs/class/System.XML/System.Xml.XPath/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.XPath/ChangeLog
@@ -1,5 +1,9 @@
2008-09-19 Atsushi Enomoto <atsushi@ximian.com>
+ * DefaultContext.cs, Expression.cs: do not premise BaseIterator.
+
+2008-09-19 Atsushi Enomoto <atsushi@ximian.com>
+
* XPathComparer.cs : no need to limit to BaseIterator.
2008-09-19 Atsushi Enomoto <atsushi@ximian.com>
diff --git a/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs b/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs
index 0685c9cf737..a13348891ff 100644
--- a/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs
+++ b/mcs/class/System.XML/System.Xml.XPath/DefaultContext.cs
@@ -52,9 +52,9 @@ namespace System.Xml.XPath
}
if (arg is string)
return ((string) arg).Length != 0;
- if (arg is BaseIterator)
+ if (arg is XPathNodeIterator)
{
- BaseIterator iter = (BaseIterator) arg;
+ XPathNodeIterator iter = (XPathNodeIterator) arg;
return iter.MoveNext ();
}
if (arg is XPathNavigator)
@@ -94,9 +94,9 @@ namespace System.Xml.XPath
return ((bool) arg) ? "true" : "false";
if (arg is double)
return ToString ((double) arg);
- if (arg is BaseIterator)
+ if (arg is XPathNodeIterator)
{
- BaseIterator iter = (BaseIterator) arg;
+ XPathNodeIterator iter = (XPathNodeIterator) arg;
if (!iter.MoveNext ())
return "";
return iter.Current.Value;
diff --git a/mcs/class/System.XML/System.Xml.XPath/Expression.cs b/mcs/class/System.XML/System.Xml.XPath/Expression.cs
index b690a8b2008..a2677d560a2 100644
--- a/mcs/class/System.XML/System.Xml.XPath/Expression.cs
+++ b/mcs/class/System.XML/System.Xml.XPath/Expression.cs
@@ -114,7 +114,7 @@ namespace System.Xml.XPath
try
{
#endif
- BaseIterator iterResults = (BaseIterator) _expr.EvaluateNodeSet (iter);
+ BaseIterator iterResults = _expr.EvaluateNodeSet (iter);
if (_sorters != null)
return _sorters.Sort (iterResults);
return iterResults;
@@ -456,8 +456,12 @@ namespace System.Xml.XPath
if (iterResult != null)
return iterResult;
XPathNavigator nav = o as XPathNavigator;
- if (nav != null)
- iterResult = nav.SelectChildren (XPathNodeType.All) as BaseIterator;
+ if (nav != null) {
+ XPathNodeIterator xiter = nav.SelectChildren (XPathNodeType.All);
+ iterResult = xiter as BaseIterator;
+ if (iterResult == null && xiter != null)
+ iterResult = new WrapperIterator (xiter, iter.NamespaceManager);
+ }
if (iterResult != null)
return iterResult;
break;