Mvp.Xml.Common.XPath.XPathNavigatorIterator.Add C# (CSharp) Method

Add() public method

Adds a XPathNavigator to the set.
public Add ( XPathNavigator navigator ) : void
navigator System.Xml.XPath.XPathNavigator The navigator to add. It's cloned automatically.
return void
        public void Add(XPathNavigator navigator)
        {
            if (_position != -1)
                throw new InvalidOperationException(Monobjc.Tools.Sdp.Properties.Resources.XPathNavigatorIterator_CantAddAfterMove);

            _navigators.Add(navigator.Clone());
        }

Same methods

XPathNavigatorIterator::Add ( IEnumerable navigators ) : void
XPathNavigatorIterator::Add ( XPathNodeIterator iterator ) : void

Usage Example

示例#1
0
        /// <summary>
        /// Implements an optimized algorithm for the following function 
        ///    node-set difference(node-set, node-set) 
        /// Uses document identification and binary search,
        /// based on the fact that a node-set is always in document order.
        /// </summary>
        /// <param name="nodeset1">An input nodeset</param>
        /// <param name="nodeset2">Another input nodeset</param>
        /// <returns>The those nodes that are in the node set 
        /// passed as the first argument that are not in the node set 
        /// passed as the second argument.</returns>
        /// <author>Dimitre Novatchev</author>

        private XPathNodeIterator difference2(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2)
        {
            List<Pair> arDocs = new List<Pair>();

            List<XPathNavigator> arNodes2 = new List<XPathNavigator>(nodeset2.Count);

            while (nodeset2.MoveNext())
            {
                arNodes2.Add(nodeset2.Current.Clone());
            }

            auxEXSLT.findDocs(arNodes2, arDocs);

            XPathNavigatorIterator enlResult = new XPathNavigatorIterator();

            while (nodeset1.MoveNext())
            {
                XPathNavigator currNode = nodeset1.Current;

                if (!auxEXSLT.findNode(arNodes2, arDocs, currNode))
                    enlResult.Add(currNode.Clone());
            }

            enlResult.Reset();
            return enlResult;
        }
All Usage Examples Of Mvp.Xml.Common.XPath.XPathNavigatorIterator::Add