public XQueryExecutable Compile(TextReader module, XQueryCompileOptions options) { XQueryCompiler compiler = CreateCompiler(options); try { return(WrapExecutable(compiler.Compile(module.ReadToEnd()), options)); } catch (Exception ex) { throw WrapCompileException(ex, compiler); } }
XQueryCompiler CreateCompiler(XQueryCompileOptions options) { XQueryCompiler compiler = this.processor.NewXQueryCompiler(); compiler.ErrorList = new ArrayList(); compiler.BaseUri = options.BaseUri.AbsoluteUri; foreach (XPathModuleInfo item in XPathModules.Modules.Where(m => m.Predeclare)) { compiler.DeclareNamespace(item.PredeclarePrefix, item.Namespace); } return(compiler); }
XQueryExecutable WrapExecutable(SaxonApiXQueryExecutable xqueryExecutable, XQueryCompileOptions options) { return(new SaxonXQueryExecutable(xqueryExecutable, this, options.BaseUri)); }
XQueryExecutable WrapExecutable(Saxon.Api.XQueryExecutable xqueryExecutable, XQueryCompileOptions options) { return new SaxonXQueryExecutable(xqueryExecutable, this, options.BaseUri); }
public XQueryExecutable Compile(TextReader module, XQueryCompileOptions options) { XQueryCompiler compiler = CreateCompiler(options); try { return WrapExecutable(compiler.Compile(module.ReadToEnd()), options); } catch (Exception ex) { throw WrapCompileException(ex, compiler); } }
public XQueryExecutable Compile(Stream module, XQueryCompileOptions options) { XQueryCompiler compiler = CreateCompiler(options); try { return WrapExecutable(compiler.Compile(module), options); } catch (Exception ex) { throw WrapCompileException(ex, compiler); } }
XQueryCompiler CreateCompiler(XQueryCompileOptions options) { XQueryCompiler compiler = this.processor.NewXQueryCompiler(); compiler.ErrorList = new ArrayList(); compiler.BaseUri = options.BaseUri.AbsoluteUri; compiler.DeclareNamespace(RequestModule.Prefix, RequestModule.Namespace); compiler.DeclareNamespace(ResponseModule.Prefix, ResponseModule.Namespace); compiler.DeclareNamespace(SessionModule.Prefix, SessionModule.Namespace); compiler.DeclareNamespace(SecurityModule.Prefix, SecurityModule.Namespace); compiler.DeclareNamespace(ValidationModule.Prefix, ValidationModule.Namespace); compiler.DeclareNamespace(UtilModule.Prefix, UtilModule.Namespace); return compiler; }