Package org.exist.xmldb

Examples of org.exist.xmldb.XPathQueryServiceImpl.query()


        result = service2.query( doc, "//item[stock=43]");
        assertEquals(1, result.getSize());

        System.out.println("testStaticVariables 3: ========");
        printResult(result);
        result = service2.query(doc, "//item");
        assertEquals(4, result.getSize());

        // assertEquals(10, result.getSize());
    }
View Full Code Here


    ResourceSet set=null;
   
    System.out.println();
    System.out.println("Query 1");
    System.out.println("=======");
    set = service.query("/book/chapter");
    res = (XMLResource) set.getResource(0);
    System.out.println(res.getContent());
   
    System.out.println();
    System.out.println("Query 2");
View Full Code Here

    System.out.println(res.getContent());
   
    System.out.println();
    System.out.println("Query 2");
    System.out.println("=======");
    set = service.query(res, "title");
    res = (XMLResource) set.getResource(0);
    System.out.println(res.getContent());
  }
}
View Full Code Here

                    DatabaseManager.getCollection("xmldb:exist://" + TestConstants.TEST_COLLECTION_URI.toString(), "admin", null);
            if (testCollection == null)
                return;
            XPathQueryServiceImpl service = (XPathQueryServiceImpl)
                    testCollection.getService("XQueryService", "1.0");
            ResourceSet result = service.query(QUERY1);
            assertEquals(expected, result.getSize());

            result = service.query(QUERY2);
            assertEquals(expected, result.getSize());
        } catch (Exception e) {
View Full Code Here

            XPathQueryServiceImpl service = (XPathQueryServiceImpl)
                    testCollection.getService("XQueryService", "1.0");
            ResourceSet result = service.query(QUERY1);
            assertEquals(expected, result.getSize());

            result = service.query(QUERY2);
            assertEquals(expected, result.getSize());
        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here

                XPathQueryServiceImpl service = (XPathQueryServiceImpl) collection.getService("XQueryService", "1.0");
                service.beginProtected();
                try {
                    if (start > 0)
                        service.declareVariable("start", new Integer(start));
                    service.query(query);
                } finally {
                    service.endProtected();
                }
            } catch (Exception e) {
                e.printStackTrace();
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.