Esempio n. 1
0
        public string DoBibFrameQuery(string saxonXqyPath, string marcxmlPath, string baseUri, string serialisation)
        {
            const string command = "bibframequery";
            var          args    = new[]
            {
                saxonXqyPath,
                "marcxmluri=" + marcxmlPath,
                "baseuri=" + baseUri,
                "serialization=" + serialisation
            };
            var options = new CommandLineOptions();

            setPermittedOptions(options);
            options.setActualOptions(args);

            config = Configuration.newConfiguration();
            config.setHostLanguage(Configuration.XQUERY);
            var dynamicEnv = new DynamicQueryContext(config);

            parseOptions(options, command, dynamicEnv);
            var staticEnv = config.newStaticQueryContext();

            staticEnv.setSchemaAware(false);

            Source sourceInput = null;

            if (sourceFileName != null)
            {
                sourceInput = processSourceFile(sourceFileName, useURLs);
            }

            var exp = compileQuery(staticEnv, queryFileName, useURLs);

            exp.setAllowDocumentProjection(projection);
            processSource(sourceInput, exp, dynamicEnv);
            var          ms          = new MemoryStream();
            OutputStream destination = new DotNetOutputStream(ms);

            runQuery(exp, dynamicEnv, destination, outputProperties);
            ms.Position = 0;
            return(new StreamReader(ms).ReadToEnd());
        }
Esempio n. 2
0
        // internal constructor

        internal XQueryEvaluator(XQueryExpression exp)
        {
            this.exp     = exp;
            this.context =
                new DynamicQueryContext(exp.getStaticContext().getConfiguration());
        }
Esempio n. 3
0
        // internal constructor

        internal XQueryEvaluator(XQueryExpression exp)
        {
            this.exp = exp;
            this.context =
                new DynamicQueryContext(exp.getStaticContext().getConfiguration());
        }