示例#1
0
        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));
        }
示例#2
0
        //------------------------------------------------------------------------
        // 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));
        }
示例#3
0
 private static IList <XPathNavigator> ToNodeSetOrRtf(IList <XPathItem> val)
 {
     return(XmlILStorageConverter.ItemsToNavigators(val));
 }