예제 #1
0
        public override void Evaluate(XslTransformProcessor p)
        {
            if (p.Debugger != null)
            {
                p.Debugger.DebugExecute(p, this.DebugInput);
            }

            // This intelligent optimization causes poor compatibility bug shown in bug #457065
//			if (children == null)
//				return;

            XPathNodeIterator iter = sortEvaluator != null?
                                     sortEvaluator.SortedSelect(p) :
                                         p.Select(select);


            while (p.NodesetMoveNext(iter))
            {
                p.PushNodeset(iter);
                p.PushForEachContext();
                children.Evaluate(p);
                p.PopForEachContext();
                p.PopNodeset();
            }
        }
예제 #2
0
        public override void Evaluate(XslTransformProcessor p)
        {
            if (p.Debugger != null)
            {
                p.Debugger.DebugExecute(p, this.DebugInput);
            }

            if (children == null)
            {
                return;
            }

            XPathNodeIterator iter = sortEvaluator != null?
                                     sortEvaluator.SortedSelect(p) :
                                         p.Select(select);


            while (p.NodesetMoveNext(iter))
            {
                p.PushNodeset(iter);
                p.PushForEachContext();
                children.Evaluate(p);
                p.PopForEachContext();
                p.PopNodeset();
            }
        }
예제 #3
0
 public object Evaluate(XslTransformProcessor p)
 {
     if (this.select != null)
     {
         object obj = p.Evaluate(this.select);
         if (obj is XPathNodeIterator)
         {
             ArrayList         arrayList         = new ArrayList();
             XPathNodeIterator xpathNodeIterator = (XPathNodeIterator)obj;
             while (xpathNodeIterator.MoveNext())
             {
                 XPathNavigator xpathNavigator = xpathNodeIterator.Current;
                 arrayList.Add(xpathNavigator.Clone());
             }
             obj = new ListIterator(arrayList, p.XPathContext);
         }
         return(obj);
     }
     if (this.content != null)
     {
         DTMXPathDocumentWriter2 dtmxpathDocumentWriter = new DTMXPathDocumentWriter2(p.Root.NameTable, 200);
         Outputter newOutput = new GenericOutputter(dtmxpathDocumentWriter, p.Outputs, null, true);
         p.PushOutput(newOutput);
         if (p.CurrentNodeset.CurrentPosition == 0)
         {
             p.NodesetMoveNext();
         }
         this.content.Evaluate(p);
         p.PopOutput();
         return(dtmxpathDocumentWriter.CreateDocument().CreateNavigator());
     }
     return(string.Empty);
 }
예제 #4
0
 protected override object GetValue(XslTransformProcessor p)
 {
     p.PushNodeset(new SelfIterator(p.Root, p.XPathContext));
     p.NodesetMoveNext();
     Evaluate(p);
     p.PopNodeset();
     return(p.globalVariableTable [this]);
 }
예제 #5
0
        public override void Evaluate(XslTransformProcessor p)
        {
            if (p.Debugger != null)
            {
                p.Debugger.DebugExecute(p, base.DebugInput);
            }
            XPathNodeIterator xpathNodeIterator = (this.sortEvaluator == null) ? p.Select(this.select) : this.sortEvaluator.SortedSelect(p);

            while (p.NodesetMoveNext(xpathNodeIterator))
            {
                p.PushNodeset(xpathNodeIterator);
                p.PushForEachContext();
                this.children.Evaluate(p);
                p.PopForEachContext();
                p.PopNodeset();
            }
        }
예제 #6
0
 public object Evaluate(XslTransformProcessor p)
 {
     if (select != null)
     {
         object o = p.Evaluate(select);
         // To resolve variable references correctly, we
         // have to collect all the target nodes here.
         // (otherwise, variables might be resolved with
         // different level of variable stack in
         // XslTransformProcessor).
         if (o is XPathNodeIterator)
         {
             ArrayList         al   = new ArrayList();
             XPathNodeIterator iter = (XPathNodeIterator)o;
             while (iter.MoveNext())
             {
                 al.Add(iter.Current.Clone());
             }
             o = new ListIterator(al, p.XPathContext);
         }
         return(o);
     }
     else if (content != null)
     {
         DTMXPathDocumentWriter2 w = new DTMXPathDocumentWriter2(p.Root.NameTable, 200);
         Outputter outputter       = new GenericOutputter(w, p.Outputs, null, true);
         p.PushOutput(outputter);
         if (p.CurrentNodeset.CurrentPosition == 0)
         {
             p.NodesetMoveNext();
         }
         content.Evaluate(p);
         p.PopOutput();
         return(w.CreateDocument().CreateNavigator());
     }
     else
     {
         return("");
     }
 }
예제 #7
0
파일: XslVariable.cs 프로젝트: nobled/mono
		public object Evaluate (XslTransformProcessor p)
		{
			if (select != null) {
				object o = p.Evaluate (select);
				// To resolve variable references correctly, we
				// have to collect all the target nodes here.
				// (otherwise, variables might be resolved with
				// different level of variable stack in
				// XslTransformProcessor).
				if (o is XPathNodeIterator) {
					ArrayList al = new ArrayList ();
					XPathNodeIterator iter = (XPathNodeIterator) o;
					while (iter.MoveNext ())
						al.Add (iter.Current.Clone ());
					o = new ListIterator (al, p.XPathContext);
				}
				return o;
			} else if (content != null) {
				DTMXPathDocumentWriter2 w = new DTMXPathDocumentWriter2 (p.Root.NameTable, 200);
				Outputter outputter = new GenericOutputter(w, p.Outputs, null, true);
				p.PushOutput (outputter);
				if (p.CurrentNodeset.CurrentPosition == 0)
					p.NodesetMoveNext ();
				content.Evaluate (p);
				p.PopOutput ();
				return w.CreateDocument ().CreateNavigator ();
			} else {
				return "";
			}
		}
예제 #8
0
파일: XslVariable.cs 프로젝트: nobled/mono
		protected override object GetValue (XslTransformProcessor p)
		{
			p.PushNodeset (new SelfIterator (p.Root, p.XPathContext));
			p.NodesetMoveNext ();
			Evaluate (p);
			p.PopNodeset ();
			return p.globalVariableTable [this];
		}
예제 #9
0
파일: XslForEach.cs 프로젝트: nobled/mono
		public override void Evaluate (XslTransformProcessor p)
		{
			if (p.Debugger != null)
				p.Debugger.DebugExecute (p, this.DebugInput);

			// This intelligent optimization causes poor compatibility bug shown in bug #457065
//			if (children == null)
//				return;

			XPathNodeIterator iter = sortEvaluator != null ?
				sortEvaluator.SortedSelect (p) :
				p.Select (select);

			
			while (p.NodesetMoveNext (iter)) {
				p.PushNodeset (iter);
				p.PushForEachContext ();
				children.Evaluate (p);
				p.PopForEachContext();
				p.PopNodeset ();
			}
		}