public static IList <XPathNavigator> ToNodeSet(IList <XPathItem> listItems) { XsltLibrary.CheckXsltValue(listItems); if (listItems.Count == 1) { return(new XmlQueryNodeSequence(ToNode(listItems[0]))); } return(XmlILStorageConverter.ItemsToNavigators(listItems)); }
//------------------------------------------------------------------------ // EnsureXXX methods (TreatAs) //------------------------------------------------------------------------ public static IList <XPathNavigator> EnsureNodeSet(IList <XPathItem> listItems) { XsltLibrary.CheckXsltValue(listItems); if (listItems.Count == 1) { XPathItem item = listItems[0]; if (!item.IsNode) { throw new XslTransformException(SR.XPath_NodeSetExpected, string.Empty); } if (item is RtfNavigator) { throw new XslTransformException(SR.XPath_RtfInPathExpr, string.Empty); } } return(XmlILStorageConverter.ItemsToNavigators(listItems)); }
private static IList <XPathNavigator> ToNodeSetOrRtf(IList <XPathItem> val) { return(XmlILStorageConverter.ItemsToNavigators(val)); }