MoveNext() public abstract méthode

public abstract MoveNext ( ) : bool
Résultat bool
Exemple #1
0
		/// <summary>
		/// Implements the following function 
		///    number max(node-set)
		/// </summary>
		/// <param name="iterator"></param>
		/// <returns></returns>		
		public double max(XPathNodeIterator iterator)
		{
			double max, t;

			if (iterator.Count == 0)
			{
				return Double.NaN;
			}

			try
			{

				iterator.MoveNext();
				max = XmlConvert.ToDouble(iterator.Current.Value);

				while (iterator.MoveNext())
				{
					t = XmlConvert.ToDouble(iterator.Current.Value);
					max = (t > max) ? t : max;
				}

			}
			catch
			{
				return Double.NaN;
			}

			return max;
		}
Exemple #2
0
		/// <summary>
		/// Implements the following function 
		///    number min(node-set)
		/// </summary>
		/// <param name="iterator"></param>
		/// <returns></returns>        
		public double min(XPathNodeIterator iterator)
		{
			double min, t;

			if (iterator.Count == 0)
			{
				return Double.NaN;
			}

			try
			{

				iterator.MoveNext();
				min = XmlConvert.ToDouble(iterator.Current.Value);


				while (iterator.MoveNext())
				{
					t = XmlConvert.ToDouble(iterator.Current.Value);
					min = (t < min) ? t : min;
				}

			}
			catch
			{
				return Double.NaN;
			}

			return min;
		}
Exemple #3
0
		/// <summary>
		/// Implements the following function 
		///    string date2:min(node-set)
		/// See http://www.xmland.net/exslt/doc/GDNDatesAndTimes-min.xml
		/// </summary>        
		/// <remarks>THIS FUNCTION IS NOT PART OF EXSLT!!!</remarks>
		public string min(XPathNodeIterator iterator)
		{

			TimeSpan min, t;

			if (iterator.Count == 0)
			{
				return "";
			}

			try
			{

				iterator.MoveNext();
				min = XmlConvert.ToTimeSpan(iterator.Current.Value);

				while (iterator.MoveNext())
				{
					t = XmlConvert.ToTimeSpan(iterator.Current.Value);
					min = (t < min) ? t : min;
				}

			}
			catch (FormatException)
			{
				return "";
			}

			return XmlConvert.ToString(min);
		}
Exemple #4
0
        internal DebuggerOptions(XPathNodeIterator iter)
        {
            while (iter.MoveNext ()) {
                switch (iter.Current.Name) {
                case "File":
                    file = iter.Current.Value;
                    break;
                case "InferiorArgs":
                    append_array (ref inferior_args, iter.Current.Value);
                    break;
                case "JitArguments":
                    append_array (ref jit_arguments, iter.Current.Value);
                    break;
                case "WorkingDirectory":
                    WorkingDirectory = iter.Current.Value;
                    break;
                case "MonoPrefix":
                    MonoPrefix = iter.Current.Value;
                    break;
                case "MonoPath":
                    MonoPath = iter.Current.Value;
                    break;
                default:
                    throw new InternalError ();
                }
            }

            if (inferior_args == null)
                inferior_args = new string [0];
        }
Exemple #5
0
		/// <summary>
		/// Implements the following function 
		///    number avg(node-set)
		/// </summary>
		/// <param name="iterator"></param>
		/// <returns>The average of all the value of all the nodes in the 
		/// node set</returns>
		/// <remarks>THIS FUNCTION IS NOT PART OF EXSLT!!!</remarks>
		public double avg(XPathNodeIterator iterator)
		{

			double sum = 0;
			int count = iterator.Count;

			if (count == 0)
			{
				return Double.NaN;
			}

			try
			{
				while (iterator.MoveNext())
				{
					sum += XmlConvert.ToDouble(iterator.Current.Value);
				}

			}
			catch (FormatException)
			{
				return Double.NaN;
			}

			return sum / count;
		}
Exemple #6
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;
        }
		public CreateLimitationForm(string strXPathRoot, string strName, XPathNodeIterator xpIterator, bool bAttribute,
			System.Collections.Specialized.StringCollection astrPreviousConstraints)
		{
			InitializeComponent();

			m_astrPreviousConstraints = astrPreviousConstraints;
			this.textBoxXPath.Text = strXPathRoot;
			this.textBoxName.Text = strName;

			while ((xpIterator != null) && xpIterator.MoveNext())
			{
				string strValue = xpIterator.Current.Value;
				if (!m_strIteratorValues.Contains(strValue))
					m_strIteratorValues.Add(strValue);
			}

			if (bAttribute)
				radioButtonSpecificValue.Checked = true;
			else
				radioButtonPresenceOnly.Checked = true;

			// only enabled on subsequent executions
			radioButtonPreviousConstraint.Enabled = (m_astrPreviousConstraints.Count > 0);

			helpProvider.SetHelpString(checkedListBox, Properties.Resources.checkedListBoxHelp);
			helpProvider.SetHelpString(flowLayoutPanelConstraintType, Properties.Resources.flowLayoutPanelConstraintTypeHelp);
		}
        public static XPathNodeIterator FilterNodes(XPathNodeIterator nodeset, string xpath)
        {
            try
            {
                while (nodeset.MoveNext())
                {
                    var nav = nodeset.Current;
                    var manager = new XmlNamespaceManager(nav.NameTable);

                    nav.MoveToFollowing(XPathNodeType.Element);

                    foreach (var ns in nav.GetNamespacesInScope(XmlNamespaceScope.All))
                    {
                        manager.AddNamespace(ns.Key, ns.Value);
                    }

                    var result = nav.Evaluate(xpath, manager);
                    if (result is XPathNodeIterator) {
                        return (XPathNodeIterator)result;
                    } else {
                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml("<result expression=\"" + xpath + "\">" + result.ToString() + "</result>");
                        return (XPathNodeIterator)doc.DocumentElement.CreateNavigator().Evaluate("/result");
                    }
                }
            }
            catch (Exception ex)
            {
                return ex.ToXPathNodeIterator();
            }

            return nodeset;
        }
Exemple #9
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)
        {
            ArrayList arDocs = new ArrayList();

            ArrayList arNodes2 = new ArrayList(nodeset2.Count);

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


            auxEXSLT.findDocs(arNodes2, arDocs);

            ExsltNodeList enlResult = new ExsltNodeList();

            while(nodeset1.MoveNext())
            {
                XPathNavigator currNode = nodeset1.Current; 
				
                if(!auxEXSLT.findNode(arNodes2, arDocs, currNode) )
                    enlResult.Add(currNode.Clone());
            }

            return ExsltCommon.ExsltNodeListToXPathNodeIterator(enlResult); 
        }
        public static string GetWsdlUrl(string referencePath)
        {
            string url = string.Empty;

            if (!string.IsNullOrEmpty(referencePath))
            {
                XPathDocument  xDoc = new XPathDocument(referencePath);
                XPathNavigator xNav = xDoc.CreateNavigator();
                string         xpathExpression;

                if (referencePath.Contains(Messages.MSG_D_SERV_REF))
                {
                    xpathExpression = @"ReferenceGroup/Metadata/MetadataFile[MetadataType='Wsdl']/@SourceUrl";
                }
                else
                {
                    xpathExpression = @"DiscoveryClientResultsFile/Results/DiscoveryClientResult[@referenceType='System.Web.Services.Discovery.ContractReference']/@url";
                }

                System.Xml.XPath.XPathNodeIterator xIter = xNav.Select(xpathExpression);
                if (xIter.MoveNext())
                {
                    url = xIter.Current.TypedValue.ToString();
                }
            }
            return(url);
        }
		public void CoreFunctionNodeSetPosition ()
		{
			expression = navigator.Compile("position()");
			iterator = navigator.Select("/foo");
			AssertEquals ("0", navigator.Evaluate ("position()").ToString ());
			AssertEquals ("0", navigator.Evaluate (expression, null).ToString ());
			AssertEquals ("0", navigator.Evaluate (expression, iterator).ToString ());
			iterator = navigator.Select("/foo/*");
			AssertEquals ("0", navigator.Evaluate (expression, iterator).ToString ());
			iterator.MoveNext();
			AssertEquals ("1", navigator.Evaluate (expression, iterator).ToString ());
			iterator.MoveNext ();
			AssertEquals ("2", navigator.Evaluate (expression, iterator).ToString ());
			iterator.MoveNext ();
			AssertEquals ("3", navigator.Evaluate (expression, iterator).ToString ());
		}
Exemple #12
0
		protected void UpdateSampleValue(XPathNodeIterator xpIterator, DataGridViewRow theRow)
		{
			if (xpIterator.MoveNext())
			{
				XPathNavigator nav = xpIterator.Current;
				UpdateExampleDataColumns(theRow, nav.Value);
			}
		}
        public ElongRegexEpression()
        {
            XPathNavigator navigator = RegexOperation.GetXPathNavigatorByPath(CommonOperation.GetConfigValueByKey(Constant.CCTRIPPATH));

            nodeIterator = navigator.Select(Constant.CREGEXEXPRESSION);

            nodeIterator.MoveNext();
        }
 static XPathNavigator[] ConvertIteratorToArray(XPathNodeIterator iterator) {
     XPathNavigator[] result = new XPathNavigator[iterator.Count];
     for (int i = 0; i < result.Length; i++) {
         iterator.MoveNext();
         result[i] = iterator.Current.Clone();
     }
     return (result);
 }
Exemple #15
0
		void ProcessAssemblies (LinkContext context, XPathNodeIterator iterator)
		{
			while (iterator.MoveNext ()) {
				AssemblyDefinition assembly = GetAssembly (context, GetFullName (iterator.Current));
				ProcessTypes (assembly, iterator.Current.SelectChildren ("type", _ns));
				ProcessNamespaces (assembly, iterator.Current.SelectChildren ("namespace", _ns));
			}
		}
 public XPathArrayIterator(XPathNodeIterator nodeIterator)
 {
     this.list = new ArrayList();
     while (nodeIterator.MoveNext())
     {
         this.list.Add(nodeIterator.Current.Clone());
     }
 }
        // get an array of nodes matching an XPath expression

        public static XPathNavigator[] ConvertNodeIteratorToArray (XPathNodeIterator iterator) {
            XPathNavigator[] result = new XPathNavigator[iterator.Count];
            for (int i = 0; i < result.Length; i++) {
                iterator.MoveNext();
                result[i] = iterator.Current.Clone();
                // clone is required or all entries will equal Current!
            }
            return(result);
        }
		public ExceptionManagerSetting(XPathNodeIterator iter)
		{
			if (iter.MoveNext())
			{
				this.EventLogType = LogTypeParser(XmlHelper.GetNavAttr(iter.Current,"eventlogtype"));
				this.m_publishlog = (XmlHelper.GetNavAttr(iter.Current,"publishlog")=="on");
				this.m_publishlogdb = (XmlHelper.GetNavAttr(iter.Current,"publishlogdb")=="on");
			}
		}
Exemple #19
0
		public CoreStringtables(XPathNodeIterator iter)
		{
			LocaleSetMap map = new LocaleSetMap(null);
			if (iter.MoveNext())
			{
				map.Init(XmlHelper.Select("localeset", iter.Current));
			}
			this.m_localeSets = map;
		}
Exemple #20
0
		public MailSetting(XPathNodeIterator iter)
		{
			if (iter.MoveNext())
			{
				this.m_smtpserver = XmlHelper.GetNavAttr(iter.Current,"smtpserver");
				this.m_mailhistory = (XmlHelper.GetNavAttr(iter.Current,"mailhistory")=="on");
				this.m_mailfaillog = (XmlHelper.GetNavAttr(iter.Current,"mailfaillog")=="on");
				this.m_charset = XmlHelper.GetNavAttr(iter.Current,"charset");
			}
		}
        public object @duration(XPathNodeIterator arg)
        {
            if (ExtensionObjectConvert.IsEmpty(arg)) {
            return ExtensionObjectConvert.EmptyIterator;
             }

             arg.MoveNext();

             return XmlConvert.ToString(XmlConvert.ToTimeSpan(arg.Current.Value));
        }
Exemple #22
0
		public SecuritySetting(XPathNodeIterator iter)
		{
			if (iter.MoveNext())
			{
				this.m_loginpage = XmlHelper.GetNavAttr(iter.Current,"loginpage");
				this.m_enable = (XmlHelper.GetNavAttr(iter.Current,"enable").ToLower()=="true");
				this.m_resourceneedauthorize = (XmlHelper.GetNavAttr(iter.Current,"resourceneedauthorize").ToLower()=="true");
				this.m_encryptionkey = XmlHelper.GetNavAttr(iter.Current,"encryptionkey");
			}
		}
        public object @float(XPathNodeIterator arg)
        {
            if (ExtensionObjectConvert.IsEmpty(arg)) {
            return ExtensionObjectConvert.EmptyIterator;
             }

             arg.MoveNext();

             return XmlConvert.ToSingle(arg.Current.Value);
        }
Exemple #24
0
 public XmlNode GetCraigslistJobDetails( XPathNodeIterator input )
 {
     input.MoveNext();
       var body = input.Current.OuterXml;
       var resultDocument = new XDocument();
       var resultElement = body.GetDetails();
       resultDocument.Add( resultElement );
       var result = resultDocument.ToXmlDocument().FirstChild;
       return result;
 }
		/// <summary>
		/// Adds a <see cref="XPathNodeIterator"/> containing a set of navigators to add.
		/// </summary>
		/// <param name="iterator">The set of navigators to add. Each one is cloned automatically.</param>
		public void Add(XPathNodeIterator iterator)
		{
			if (_position != -1) 
				throw new InvalidOperationException(
					SR.XPathNavigatorIterator_CantAddAfterMove);

			while (iterator.MoveNext())
			{
				_navigators.Add(iterator.Current.Clone());
			}
		}
 internal void Add(XPathNodeIterator iter)
 {
     while (iter.MoveNext())
     {
         SeekableXPathNavigator current = iter.Current as SeekableXPathNavigator;
         if (current == null)
         {
             throw DiagnosticUtility.ExceptionUtility.ThrowHelperCritical(new QueryProcessingException(QueryProcessingError.Unexpected, System.ServiceModel.SR.GetString("QueryMustBeSeekable")));
         }
         this.Add(current);
     }
 }
Exemple #27
0
 //=================================================================================================
 public string get_value( string xsXmlPath )
 {
     moIt=moPath.Select( xsXmlPath ) ;
     if( moIt.MoveNext() )
     {
         return moIt.Current.Value ;
     }
     else
     {
         return "";
     }            
 }
		void ProcessNamespaces (AssemblyDefinition assembly, XPathNodeIterator iterator)
		{
			while (iterator.MoveNext ()) {
				string fullname = GetFullName (iterator.Current);
				foreach (TypeDefinition type in assembly.MainModule.Types) {
					if (type.Namespace != fullname)
						continue;

					MarkAndPreserveAll (type);
				}
			}
		}
Exemple #29
0
				/// <summary>
				/// Implements the following function 
				///    node-set distinct(node-set)
				/// </summary>
				/// <param name="nodeset">The input nodeset</param>
				/// <returns>Returns the nodes in the nodeset whose string value is 
				/// distinct</returns>
				public static XPathNodeIterator distinct(XPathNodeIterator nodeset){
				
					ExsltNodeList nodelist = new ExsltNodeList();

					while(nodeset.MoveNext()){
						if(!nodelist.ContainsValue(nodeset.Current.Value)){
							nodelist.Add(nodeset.Current.Clone()); 
						}					
					}
					 
					return ExsltCommon.ExsltNodeListToXPathNodeIterator(nodelist); 

				}
 private static void CleanAttributes(XPathNodeIterator xPathIt)
 {
     string temp;
     if (xPathIt.Count > 0)
     {
         while (xPathIt.MoveNext())
         {
             temp = xPathIt.Current.Value + " - " + xPathIt.CurrentPosition;
             xPathIt.Current.SetValue("");
             xPathIt.Current.CreateAttribute(String.Empty, "nil", String.Empty, "true");
         }
     }
 }
Exemple #31
0
        /// <summary>
        /// Override method that performs the actual property setting from a Navigator result.
        /// </summary>
        /// <param name="component"></param>
        /// <param name="data"></param>
        /// <param name="context"></param>
        protected override void DoBindComponent(object component, object data, PDFDataContext context)
        {
            System.Xml.XPath.XPathExpression expr = this.GetExpression(data, context);

            if (data is System.Xml.XPath.XPathNodeIterator)
            {
                data = ((System.Xml.XPath.XPathNodeIterator)data).Current;
            }

            System.Xml.XPath.XPathNavigator nav = (System.Xml.XPath.XPathNavigator)data;

            if (null == this.Converter)
            {
                var iterator = nav.Select(expr);

                if (this.Property.PropertyType == typeof(XPathNavigator))
                {
                    this.Property.SetValue(component, iterator.Current);
                }
                else
                {
                    this.Property.SetValue(component, iterator);
                }
            }
            else
            {
                System.Xml.XPath.XPathNodeIterator itter = nav.Select(expr);

                if (itter.CurrentPosition < 0)
                {
                    itter.MoveNext();
                }

                string value     = itter.Current.Value;
                object converted = this.Converter(value, this.Property.PropertyType, System.Globalization.CultureInfo.CurrentCulture);


                if (context.ShouldLogVerbose)
                {
                    context.TraceLog.Add(TraceLevel.Verbose, "Item Binding", "Setting property '" + this.Property.Name + "' with the XPath binding expression '" + expr.Expression + "' to value '" + ((null == value) ? "NULL" : value) + "'");
                }

                this.Property.SetValue(component, converted, null);
            }
        }
Exemple #32
0
        internal XPathNavigator PeekNext()
        {
            XPathNodeIterator xpathNodeIterator = this.Clone();

            return((!xpathNodeIterator.MoveNext()) ? null : xpathNodeIterator.Current);
        }
Exemple #33
0
 public override bool MoveNextCore()
 {
     return(iter.MoveNext());
 }
Exemple #34
0
        internal XPathNavigator PeekNext()
        {
            XPathNodeIterator i = Clone();

            return(i.MoveNext() ? i.Current : null);
        }
Exemple #35
0
        internal override XPathNavigator advance()
        {
            if (_eLast == null)
            {
                XPathNavigator temp = null;
                _eLast = m_qyInput.advance();
                if (_eLast == null)
                {
                    return(null);
                }

                while (_eLast != null)
                {
                    _eLast = _eLast.Clone();
                    temp   = _eLast;
                    _eLast = m_qyInput.advance();
                    if (!temp.IsDescendant(_eLast))
                    {
                        break;
                    }
                }
                _eLast = temp;
            }
            while (true)
            {
                if (_first)
                {
                    _first = false;
                    if (_eLast.NodeType == XPathNodeType.Attribute || _eLast.NodeType == XPathNodeType.Namespace)
                    {
                        _eLast.MoveToParent();
                        if (_fMatchName)
                        {
                            _qy = _eLast.SelectDescendants(m_Name, m_URN, false);
                        }
                        else
                        {
                            _qy = _eLast.SelectDescendants(m_Type, false);
                        }
                    }
                    else
                    {
                        while (true)
                        {
                            if (!_eLast.MoveToNext())
                            {
                                if (!_eLast.MoveToParent())
                                {
                                    _first = true;
                                    return(null);
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                        if (_fMatchName)
                        {
                            _qy = _eLast.SelectDescendants(m_Name, m_URN, true);
                        }
                        else
                        {
                            _qy = _eLast.SelectDescendants(m_Type, true);
                        }
                    }
                }
                if (_qy.MoveNext())
                {
                    _position++;
                    m_eNext = _qy.Current;
                    return(m_eNext);
                }
                else
                {
                    _first = true;
                }
            }
        }
Exemple #36
-3
        private void EditCand_Load(object sender, EventArgs e)
        {
            doc = new XPathDocument(FILE_NAME);
            nav = doc.CreateNavigator();

            // Compile a standard XPath expression

            expr = nav.Compile("/config/voto/@puesto");
            iterator = nav.Select(expr);

            // Iterate on the node set
            comboBox1.Items.Clear();
            try
            {
                while (iterator.MoveNext())
                {
                    XPathNavigator nav2 = iterator.Current.Clone();
                    comboBox1.Items.Add(nav2.Value);
                    comboBox1.SelectedIndex = 0;

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }


            //save old title 
            oldTitle = comboBox1.Text;

        }