Package org.exist.xmldb

Examples of org.exist.xmldb.XQueryService.execute()


                Resource resource = collection.createResource(file.getName(), "XMLResource");
                resource.setContent(file);
                collection.storeResource(resource);
            }
            XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
            ResourceSet result = service.execute(new ClassLoaderSource("/org/exist/performance/log2html.xql"));

            if (directory == null)
                directory = new File(System.getProperty("user.dir"));
            File htmlFile = new File(directory, "results.html");
            FileUtils.writeStringToFile(htmlFile, result.getResource(0).getContent().toString(), "UTF-8");
View Full Code Here


            for (int i = 0; i < count; i++) {
                File nextFile = new File(directory, prefix + i + ".xml");
               
                service.declareVariable("filename", nextFile.getName());
                service.declareVariable("count", new IntegerValue(i));
                ResourceSet results = service.execute(compiled);

                Writer out = new OutputStreamWriter(new FileOutputStream(nextFile), "UTF-8");
                for (ResourceIterator iter = results.getIterator(); iter.hasMoreResources(); ) {
                    Resource r = iter.nextResource();
                    out.write(r.getContent().toString());
View Full Code Here

        // In this way we can see the parsed structure meanwhile the query is
        StringWriter writer = new StringWriter();
        service.dump(compiled, writer);
        exprDisplay.setText(writer.toString());
       
        result = service.execute(compiled);
        context = null;
        tResult = System.currentTimeMillis() - t1;
       
        // jmfg: Is this still needed? I don't think so
        writer = new StringWriter();
View Full Code Here

            CompiledExpression compiled = service.compile( query );
           
            long start = System.currentTimeMillis();
           
            // execute query and get results in ResourceSet
            ResourceSet result = service.execute( compiled );

            long qtime = System.currentTimeMillis() - start;
            start = System.currentTimeMillis();
           
            Properties outputProperties = new Properties();
View Full Code Here

                String query = "update insert <node id='id" + Integer.toHexString(i) + "'>" +
                        "<p>Some longer text <b>content</b> in this node. Some longer text <b>content</b> in this node. " +
                        "Some longer text <b>content</b> in this node. Some longer text <b>content</b> in this node.</p>" +
                        "</node> " +
                        "into //test[@id = 't1']";
                service.execute(new StringSource(query));
            }
        } catch (XMLDBException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.