Beispiel #1
0
        public Nodes query(string xPath, XPathContext namespaces)
        {
            IList<XElement> descendantElements = new List<XElement>();
            if (!(this.XNode is XContainer)) return new Nodes(descendantElements);

            var xContainer = this.XNode as XContainer;
            var name = GetName(xPath);
            foreach (var element in xContainer.Descendants())
            {
                if (element.Name.LocalName.Equals(name))
                {
                    descendantElements.Add(element);
                }
            }
            return new Nodes(descendantElements);
        }
Beispiel #2
0
        public Nodes query(string xPath, XPathContext namespaces)
        {
            IList <XElement> descendantElements = new List <XElement>();

            if (!(this.XNode is XContainer))
            {
                return(new Nodes(descendantElements));
            }

            var xContainer = this.XNode as XContainer;
            var name       = GetName(xPath);

            foreach (var element in xContainer.Descendants())
            {
                if (element.Name.LocalName.Equals(name))
                {
                    descendantElements.Add(element);
                }
            }
            return(new Nodes(descendantElements));
        }