2
0
Эх сурвалжийг харах

2003-07-27 Piers Haken <[email protected]>

	* Expression.cs: allow EvaluateNodeSet to take XPathResultType.Any

svn path=/trunk/mcs/; revision=16751
Piers Haken 22 жил өмнө
parent
commit
f203457fdf

+ 5 - 1
mcs/class/System.XML/System.Xml.XPath/ChangeLog

@@ -1,7 +1,11 @@
+2003-07-27  Piers Haken	<[email protected]>
+
+	* Expression.cs: allow EvaluateNodeSet to take XPathResultType.Any
+
 2003-07-26  Piers Haken	<[email protected]>
 
 	* Expression.cs: fix function evaluation with ambigous argument types
-	* XPathnavigator.cs: fix silly null reference bug
+	* XPathNavigator.cs: fix silly null reference bug
 
 2003-07-26  Piers Haken	<[email protected]>
 

+ 8 - 2
mcs/class/System.XML/System.Xml.XPath/Expression.cs

@@ -284,8 +284,14 @@ namespace System.Xml.XPath
 
 		public BaseIterator EvaluateNodeSet (BaseIterator iter)
 		{
-			if (GetReturnType (iter) == XPathResultType.NodeSet)
-				return (BaseIterator) Evaluate (iter);
+			XPathResultType type = GetReturnType (iter);
+			if (type == XPathResultType.NodeSet ||
+				type == XPathResultType.Any)
+			{
+				BaseIterator iterResult = Evaluate (iter) as BaseIterator;
+				if (iterResult != null)
+					return iterResult;
+			}
 			throw new XPathException ("expected nodeset: "+ToString ());
 		}
 		protected static XsltContext DefaultContext { get { return _ctxDefault; } }