Exemple #1
0
		public void Execute (XPathNavigator input, XmlResolver resolver, XmlArgumentList args, XmlWriter writer)
		{
			if (staticContext == null)
				throw new XmlQueryException ("Query string is not compiled.");
			// Initialize event handler method info.
			xqueryCommandOnMessageEventMethod = null;

			XQueryContext ctx = new XQueryContext (new XQueryContextManager (staticContext, input, writer, resolver, args));

			XPathSequence iter = new SingleItemIterator (input, ctx);

			foreach (ExprSingle expr in staticContext.QueryBody)
				expr.Serialize (iter);
		}
Exemple #2
0
		internal XQueryContextManager (XQueryStaticContext ctx, XPathItem input, XmlWriter writer, XmlResolver resolver, XmlArgumentList args)
		{
			this.input = input;
			this.staticContext = ctx;
			this.args = args;
			currentWriter = writer;
			this.extDocResolver = resolver;

			namespaceManager = new XmlNamespaceManager (ctx.NameTable);
			foreach (DictionaryEntry de in ctx.NSResolver.GetNamespacesInScope (XmlNamespaceScope.ExcludeXml))
				namespaceManager.AddNamespace (de.Key.ToString (), de.Value.ToString ());
			namespaceManager.PushScope ();

			currentContext = new XQueryContext (this, null, new Hashtable ());
			if (input != null) {
				currentSequence = new SingleItemIterator (input, currentContext);
				currentSequence.MoveNext ();
			}
			currentContext = new XQueryContext (this, currentSequence, new Hashtable ());
		}