Package org.exist.xmldb

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


        XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
        service.declareVariable("filename", "");
        service.declareVariable("count", "0");
        String query = IMPORT + xqueryContent;
        System.out.println("query: " + query);
        CompiledExpression compiled = service.compile(query);
        try {
            for (int i = 0; i < count; i++) {
                File nextFile = new File(directory, prefix + i + ".xml");
               
                service.declareVariable("filename", nextFile.getName());
View Full Code Here


     
      try {
        final XQueryService service= (XQueryService) collection.getService("XQueryService", "1.0");
        service.setProperty(OutputKeys.INDENT, properties.getProperty(OutputKeys.INDENT, "yes"));
        final long t0 = System.currentTimeMillis();
        final CompiledExpression compiled = service.compile(xpath);
        final long t1 = System.currentTimeMillis();
        tCompiled = t1 - t0;
       
        // In this way we can see the parsed structure meanwhile the query is
        final StringWriter writer = new StringWriter();
View Full Code Here

       
        if (resource != null) {
                    service.setModuleLoadPath(XmldbURI.EMBEDDED_SERVER_URI_PREFIX + resource.getParentCollection().getName());
                }
       
        final CompiledExpression compiled = service.compile(xpath);
        final long t1 = System.currentTimeMillis();
        // Check could also be collection instanceof LocalCollection
        if(compiled instanceof CompiledXQuery)
          {context = ((CompiledXQuery)compiled).getContext();}
        tCompiled = t1 - t0;
View Full Code Here

           
            // set pretty-printing on
            service.setProperty( OutputKeys.INDENT, "yes" );
            service.setProperty( OutputKeys.ENCODING, "UTF-8" );
           
            CompiledExpression compiled = service.compile( query );
           
            long start = System.currentTimeMillis();
           
            // execute query and get results in ResourceSet
            ResourceSet result = service.execute( compiled );
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.