/// <summary>
        /// Executes a query against a database - returns the result for pretty displaying of the data in xslt
        /// </summary>
        /// <param name="args">
        /// Accepts a piece of xml that can be mapped to the  Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset method.
        /// 
        /// Read about it here: http://projekt.chainbox.dk/default.asp?W258
        /// </param>
        /// <returns>
        /// The first datatable returned by the query 
        /// 
        /// <root>
        ///  <item>
        ///    <fieldname>fieldvalue</fieldname>
        ///    <fieldname>fieldvalue</fieldname>
        ///    <fieldname>fieldvalue</fieldname>
        ///  </item>
        ///  <item>
        ///    <fieldname>fieldvalue</fieldname>
        ///    <fieldname>fieldvalue</fieldname>
        ///    <fieldname>fieldvalue</fieldname>
        ///  </item>
        /// </root>
        /// 
        /// </returns>
        public static XPathNodeIterator ExecuteDataset(XPathNodeIterator args)
        {
            try
            {
                XPathNodeIterator retval;
                SqlHelperArgs sqlargs = ParseArgs(args);
                DataSet ds = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(sqlargs.ConnectionString, sqlargs.CommandType, sqlargs.CommandText, sqlargs.Params.ToArray());
                XmlDocument xd = new XmlDocument();
                ds.DataSetName = "root";
                // this is bad - the query might not return anything - but hey this is webdevelopment.
                ds.Tables[0].TableName = "item";

                using (StringWriter sw = new StringWriter())
                {
                    ds.WriteXml(sw);
                    xd.LoadXml(sw.ToString());
                }
                retval = xd.CreateNavigator().Select(".");

                WriteToTrace("ExecuteDataset: Returning data from:" + sqlargs.CommandText + " without using cache");
                return retval;
            }
            catch (Exception ex)
            {
                WriteToTrace(ex.ToString());
                return EmptyXpathNodeIterator(ex, "Xslt.ApplicationBlocks.Data.ExecuteDataset", true);
            }
        }
Example #2
0
		private static IEnumerable<object> GetUnderlyingXObjects(XPathNodeIterator nodeIterator)
		{
			foreach (XPathNavigator nav in nodeIterator)
			{
				yield return nav.UnderlyingObject;
			}
		}
Example #3
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;
		}
Example #4
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;
		}
Example #5
0
        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;
        }
 internal XPathResult(XPathNodeIterator nodeSetResult)
     : this()
 {
     this.nodeSetResult = nodeSetResult;
     this.internalIterator = nodeSetResult as SafeNodeSequenceIterator;
     this.resultType = XPathResultType.NodeSet;
 }
 public override object Evaluate(XPathNodeIterator context)
 {
     base.Evaluate(context);
     List<XPathNavigator> parentStk = new List<XPathNavigator>();
     Stack<XPathNavigator> stack = new Stack<XPathNavigator>();
     while ((base.currentNode = base.qyInput.Advance()) != null)
     {
         stack.Push(base.currentNode.Clone());
     }
     while (stack.Count != 0)
     {
         XPathNavigator nav = stack.Pop();
         if (((nav.NodeType != XPathNodeType.Attribute) && (nav.NodeType != XPathNodeType.Namespace)) && this.NotVisited(nav, parentStk))
         {
             XPathNavigator e = nav.Clone();
             if (e.MoveToParent())
             {
                 e.MoveToFirstChild();
                 while (!e.IsSamePosition(nav))
                 {
                     if (this.matches(e))
                     {
                         base.Insert(base.outputBuffer, e);
                     }
                     if (e.MoveToNext())
                     {
                     }
                 }
             }
         }
     }
     return this;
 }
Example #8
0
        public override object Evaluate(XPathNodeIterator nodeIterator)
        {
            if (xsltContext == null)
            {
                throw XPathException.Create(SR.Xp_NoContext);
            }

            // calculate arguments:
            object[] argVals = new object[_args.Count];
            for (int i = 0; i < _args.Count; i++)
            {
                argVals[i] = _args[i].Evaluate(nodeIterator);
                if (argVals[i] is XPathNodeIterator)
                {// ForBack Compat. To protect our queries from users.
                    argVals[i] = new XPathSelectionIterator(nodeIterator.Current, _args[i]);
                }
            }
            try
            {
                return ProcessResult(_function.Invoke(xsltContext, argVals, nodeIterator.Current));
            }
            catch (Exception ex)
            {
                throw XPathException.Create(SR.Xp_FunctionFailed, QName, ex);
            }
        }
Example #9
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;
		}
Example #10
0
 public override object Evaluate(XPathNodeIterator nodeIterator)
 {
     return GetValue(_op,
         XmlConvertEx.ToXPathDouble(_opnd1.Evaluate(nodeIterator)),
         XmlConvertEx.ToXPathDouble(_opnd2.Evaluate(nodeIterator))
     );
 }
Example #11
0
		/// <summary>
		/// Implements the following function 
		///    node-set highest(node-set)
		/// </summary>
		/// <param name="iterator">The input nodeset</param>
		/// <returns>All the nodes that contain the max value in the nodeset</returns>		
		public static XPathNodeIterator highest(XPathNodeIterator iterator){

			ExsltNodeList newList = new ExsltNodeList(); 
			double max, t; 

			if(iterator.Count == 0){
				return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList);  
			}


			try{ 

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

				while (iterator.MoveNext()){
					t = XmlConvert.ToDouble(iterator.Current.Value);
				
					if(t > max){
						max =  t;
						newList.Clear(); 
						newList.Add(iterator.Current.Clone()); 
					}else if( t == max){
						newList.Add(iterator.Current.Clone()); 
					}
				}
				
			}catch(Exception){ //return empty node set
				newList.Clear(); 
				return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList);  
			}

			return ExsltCommon.ExsltNodeListToXPathNodeIterator(newList); 
		}
Example #12
0
        public List<TSK> Read(XPathNodeIterator iterator)
        {
            var tsks = new List<TSK>();
            if (iterator.Count == 0)
                return tsks;

            foreach (XPathNavigator node in iterator)
            {
                if (node.SelectChildren("TLG", node.NamespaceURI).Count == 0)
                    continue;

                var tsk = new TSK
                {
                    A = GetStringValue(node, "A"),
                    B = GetStringValue(node, "B"),
                    C = GetStringValue(node, "C"),
                    D = GetStringValue(node, "D"),
                    E = GetStringValue(node, "E"),
                    F = GetStringValue(node, "F"),
                    G = GetEnumValue(node, "G"),
                    H = GetByteValue(node, "H"),
                    I = GetByteValue(node, "I"),
                    J = GetByteValue(node, "J"),
                    Items = GetItems(node),
                };

                tsks.Add(tsk);
            }

            return tsks;
        }
Example #13
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];
        }
 public override XPathNavigator Advance()
 {
     while (!this.iterator.MoveNext())
     {
         XPathNavigator navigator = base.qyInput.Advance();
         if (navigator == null)
         {
             return null;
         }
         if (base.NameTest)
         {
             if (base.TypeTest == XPathNodeType.ProcessingInstruction)
             {
                 this.iterator = new IteratorFilter(navigator.SelectChildren(base.TypeTest), base.Name);
             }
             else
             {
                 this.iterator = navigator.SelectChildren(base.Name, base.Namespace);
             }
         }
         else
         {
             this.iterator = navigator.SelectChildren(base.TypeTest);
         }
         base.position = 0;
     }
     base.position++;
     base.currentNode = this.iterator.Current;
     return base.currentNode;
 }
        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 override object Evaluate(XPathNodeIterator nodeIterator) {
     object n1 = opnd1.Evaluate(nodeIterator);
     if (((bool) n1) == isOr) {
         return n1;
     }
     return opnd2.Evaluate(nodeIterator);
 }
Example #17
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); 
        }
Example #18
0
        private List<TSK> GetExternalTasks(string path, XPathNodeIterator externalChildren)
        {
            var items = new List<TSK>();
            foreach (XPathNavigator node in externalChildren)
            {
                var attribute = node.GetAttribute("A", node.NamespaceURI);
                if (attribute.StartsWith("TSK"))
                {
                    var filename = Path.Combine(path, attribute + ".xml");

                    if(!File.Exists(filename))
                        continue;

                    var externalTaskElements = new XPathDocument(filename).CreateNavigator()
                        .SelectSingleNode(XFC)
                        .SelectChildren(XPathNodeType.Element)
                        .Current.Select("./" + TSK);

                    var externalTsks = _tsksReader.Read(externalTaskElements);
                    items.AddRange(externalTsks);
                }
            }

            return items;
        }
        public override object Evaluate(XPathNodeIterator nodeIterator) {
			if (xsltContext == null) {
				throw XPathException.Create(Res.Xp_NoContext);
			}

            return ProcessResult(variable.Evaluate(xsltContext));
        }
Example #20
0
        public override object Evaluate(XPathNodeIterator context) {
            object argVal = base.Evaluate(context);
            XPathNavigator contextNode = context.Current.Clone();

            switch (GetXPathType(argVal)) {
            case XPathResultType.NodeSet:
                XPathNavigator temp;
                while ((temp = input.Advance()) != null) {
                    ProcessIds(contextNode, temp.Value);
                }
                break;
            case XPathResultType.String:
                ProcessIds(contextNode, (string)argVal);
                break;
            case XPathResultType.Number:
                ProcessIds(contextNode, StringFunctions.toString((double)argVal));
                break;
            case XPathResultType.Boolean:
                ProcessIds(contextNode, StringFunctions.toString((bool)argVal));
                break;
            case XPathResultType_Navigator:
                ProcessIds(contextNode, ((XPathNavigator)argVal).Value);
                break;
            }
            return this;
        }
Example #21
0
 public override object Evaluate(XPathNodeIterator context)
 {
     outputBuffer.Clear();
     count = 0;
     return input.Evaluate(context);// This is trick. IDQuery needs this value. Otherwise we would return this.
                                    // All subclasses should and would anyway override thismethod and return this.
 }
Example #22
0
 internal override void reset() 
 {
     _eLast = null;
     _qy = null;
     _first = true;
     base.reset();
 }
        public override XPathNavigator Advance() {
            while (true) {
                if (nodeIterator == null) {
                    position = 0;
                    XPathNavigator nav = qyInput.Advance();
                    if (nav == null) {
                        return null;
                    }
                    if (NameTest) {
                        if (TypeTest == XPathNodeType.ProcessingInstruction) {
                            nodeIterator = new IteratorFilter(nav.SelectDescendants(TypeTest, matchSelf), Name);
                        } else {
                            nodeIterator = nav.SelectDescendants(Name, Namespace, matchSelf);
                        }
                    } else {
                        nodeIterator = nav.SelectDescendants(TypeTest, matchSelf);
                    }
                }

                if (nodeIterator.MoveNext()) {
                    position++;
                    currentNode = nodeIterator.Current;
                    return currentNode;
                } else {
                    nodeIterator = null;
                }
            }
        }
        public override object Evaluate(XPathNodeIterator context) {
            base.Evaluate(context);

            // Fill up base.outputBuffer
            List<XPathNavigator> parentStk = new List<XPathNavigator>();
            Stack<XPathNavigator> inputStk = new Stack<XPathNavigator>();
            while ((currentNode = qyInput.Advance()) != null) {
                inputStk.Push(currentNode.Clone());
            }
            while (inputStk.Count != 0) {
                XPathNavigator input = inputStk.Pop();
                if (input.NodeType == XPathNodeType.Attribute || input.NodeType == XPathNodeType.Namespace) {
                    continue;
                }
                if (NotVisited(input, parentStk)) {
                    XPathNavigator prev = input.Clone();
                    if (prev.MoveToParent()) {
                        bool test = prev.MoveToFirstChild();
                        Debug.Assert(test, "We just moved to parent, how we can not have first child?");
                        while (!prev.IsSamePosition(input)) {
                            if (matches(prev)) {
                                Insert(outputBuffer, prev);
                            }
                            if (!prev.MoveToNext()) {
                                Debug.Fail("We managed to miss sentinel node (input)");
                                break;
                            }
                        }
                    }
                }
            }
            return this;
        }
Example #25
0
        internal override XPathNavigator advance() {
            while (true) {
                if (_count == 0) {
                    m_eNext = m_qyInput.advance();
                    if (m_eNext == null ){
                        return null;
                    }
                    if( _fMatchName ) {
                        if( m_Type == XPathNodeType.ProcessingInstruction ) {
                            _iterator = new IteratorFilter( m_eNext.SelectChildren( m_Type ), m_Name );
                        }
                        else {
                            _iterator = m_eNext.SelectChildren( m_Name, m_URN );
                        }

                    }
                    else {
                        _iterator = m_eNext.SelectChildren( m_Type );
                    }
                    _count = 1;
                    _position = 0;
                }
                if( _iterator.MoveNext() ) {
                    _position++;
                    m_eNext = _iterator.Current;
                    return m_eNext;
                }
                else {
                    _count = 0;
                }

            }
        } // Advance
Example #26
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);
		}
 public override object Evaluate(XPathNodeIterator context)
 {
     base.contextNode = context.Current.Clone();
     base.contextNode.MoveToRoot();
     base.count = 0;
     return this;
 }
        public override object Evaluate(XPathNodeIterator context)
        {
            object obj2 = base.Evaluate(context);
            XPathNavigator contextNode = context.Current.Clone();
            switch (base.GetXPathType(obj2))
            {
                case XPathResultType.Number:
                    this.ProcessIds(contextNode, StringFunctions.toString((double) obj2));
                    break;

                case XPathResultType.String:
                    this.ProcessIds(contextNode, (string) obj2);
                    break;

                case XPathResultType.Boolean:
                    this.ProcessIds(contextNode, StringFunctions.toString((bool) obj2));
                    break;

                case XPathResultType.NodeSet:
                    XPathNavigator navigator2;
                    while ((navigator2 = base.input.Advance()) != null)
                    {
                        this.ProcessIds(contextNode, navigator2.Value);
                    }
                    break;

                case ((XPathResultType) 4):
                    this.ProcessIds(contextNode, ((XPathNavigator) obj2).Value);
                    break;
            }
            return this;
        }
Example #29
0
 private double Number(XPathNodeIterator nodeIterator)
 {
     if (_arg == null)
     {
         return XmlConvertEx.ToXPathDouble(nodeIterator.Current.Value);
     }
     object argVal = _arg.Evaluate(nodeIterator);
     switch (GetXPathType(argVal))
     {
         case XPathResultType.NodeSet:
             XPathNavigator value = _arg.Advance();
             if (value != null)
             {
                 return Number(value.Value);
             }
             break;
         case XPathResultType.String:
             return Number((string)argVal);
         case XPathResultType.Boolean:
             return Number((bool)argVal);
         case XPathResultType.Number:
             return (double)argVal;
         case XPathResultType_Navigator:
             return Number(((XPathNavigator)argVal).Value);
     }
     return double.NaN;
 }
 private XPathNavigator EvaluateArg(XPathNodeIterator context) {
     if (arg == null) {
         return context.Current;
     }
     arg.Evaluate(context);
     return arg.Advance();
 }
Example #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);
            }
        }
        protected override bool DoEvaluateTestExpression(string expr, object withData, PDFDataContext context)
        {
            System.Xml.XPath.XPathNavigator nav;
            if (withData is System.Xml.XPath.XPathNavigator)
            {
                nav = withData as System.Xml.XPath.XPathNavigator;
            }
            else
            {
                throw new NotSupportedException("The XmlDataSource can only perfrom select operations on XPathNavigator data.");
            }

            object result;

            if (string.IsNullOrEmpty(expr))
            {
                result = nav.Evaluate("*", context.NamespaceResolver);
            }
            else
            {
                result = nav.Evaluate(expr, context.NamespaceResolver);
            }

            if (result is bool)
            {
                return((bool)result);
            }
            else if (result is System.Xml.XPath.XPathNodeIterator)
            {
                System.Xml.XPath.XPathNodeIterator itter = (System.Xml.XPath.XPathNodeIterator)result;
                return(itter.Count > 0);
            }
            else
            {
                return(null != result);
            }
        }
Example #33
0
 override internal object getValue(XPathNavigator qyContext, XPathNodeIterator iterator)
 {
     return(m_qyInput.getValue(qyContext, iterator));
 }
Example #34
0
 public Enumerator(XPathNodeIterator original)
 {
     _original = original.Clone();
 }
Example #35
0
 internal override object getValue(XPathNavigator qy, XPathNodeIterator iterator)
 {
     return(_Var);
 }
Example #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;

        }