Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
 XQueryExecutable WrapExecutable(SaxonApiXQueryExecutable xqueryExecutable, XQueryCompileOptions options)
 {
     return(new SaxonXQueryExecutable(xqueryExecutable, this, options.BaseUri));
 }
Пример #4
0
 XQueryExecutable WrapExecutable(Saxon.Api.XQueryExecutable xqueryExecutable, XQueryCompileOptions options) {
    return new SaxonXQueryExecutable(xqueryExecutable, this, options.BaseUri);
 }
Пример #5
0
      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);
         }
      }
Пример #6
0
      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);
         }
      }
Пример #7
0
      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;
      }