Exemplo n.º 1
0
        static String test(String query)
        {
            MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler();

            InMemoryStore store = InMemoryStore.getInstance();
            Zorba         zorba = Zorba.getInstance(store);

            XQuery        xquery   = zorba.compileQuery(query, diagnosticHandler);
            StringBuilder sbuilder = new StringBuilder();
            Iterator      iter     = xquery.iterator();

            iter.open();
            Item item = new Item();

            while (iter.next(item))
            {
                sbuilder.Append(item.getStringValue());
            }
            iter.close();
            iter.Dispose();
            xquery.destroy();
            xquery.Dispose();

            zorba.shutdown();
            InMemoryStore.shutdown(store);

            return(sbuilder.ToString());
        }
Exemplo n.º 2
0
        static string test(string query, string xml, string doc)
        {
            InMemoryStore store = InMemoryStore.getInstance();
            Zorba         zorba = Zorba.getInstance(store);

            XmlDataManager dataManager = zorba.getXmlDataManager();
            Iterator       docIter     = dataManager.parseXML(xml);

            docIter.open();
            Item idoc = new Item();

            docIter.next(idoc);
            docIter.close();
            docIter.Dispose();

            DocumentManager docManager = dataManager.getDocumentManager();

            docManager.put(doc, idoc);

            XQuery xquery = zorba.compileQuery(query);
            string result = xquery.execute();

            xquery.destroy();
            xquery.Dispose();

            zorba.shutdown();
            InMemoryStore.shutdown(store);

            return(result);
        }
Exemplo n.º 3
0
        static String test(String query)
        {
            InMemoryStore store = InMemoryStore.getInstance();
            Zorba         zorba = Zorba.getInstance(store);

            XQuery xquery = zorba.compileQuery(query);
            String result = xquery.printPlanAsDOT();

            xquery.destroy();
            xquery.Dispose();

            zorba.shutdown();
            InMemoryStore.shutdown(store);

            return(result);
        }
Exemplo n.º 4
0
        static void test(String query)
        {
            InMemoryStore store = InMemoryStore.getInstance();
            Zorba         zorba = Zorba.getInstance(store);

            XQuery xquery = zorba.compileQuery(query);

            Iterator iterator = xquery.iterator();

            printIterator(iterator, "");

            xquery.destroy();
            xquery.Dispose();

            zorba.shutdown();
            InMemoryStore.shutdown(store);

            return;
        }
Exemplo n.º 5
0
        static String test(String query)
        {
            MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler();

            InMemoryStore store = InMemoryStore.getInstance();
            Zorba         zorba = Zorba.getInstance(store);

            XQuery xquery = zorba.compileQuery(query, diagnosticHandler);

            StringBuilder sbuilder = new StringBuilder();

            sbuilder.Append(xquery.execute());

            xquery.destroy();
            xquery.Dispose();

            zorba.shutdown();
            InMemoryStore.shutdown(store);

            return(sbuilder.ToString());
        }