Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.XQueryService.query()


    @Test (expected=XMLDBException.class)
    public void appendIdref() throws XMLDBException {
        XQueryService xqs = (XQueryService) testCollection.getService("XQueryService", "1.0");
        String query =
            "<results>{fn:idref(('id1', 'id2'), doc('/db/test/docdtd.xml')/IDS)}</results>";
        ResourceSet result = xqs.query(query);
        System.out.println(result.getResource(0).getContent());
    }

    @BeforeClass
    public static void initDB() {
View Full Code Here


        "<test xmlns='http://www.foo.com'>\n" +
        "{\n" +
        "  update insert attribute { 'ID' } { 'myid' } into /t:test\n" +
        "}\n" +
        "</test>";
      service.query(query);
     
      query =
        "declare namespace t='http://www.foo.com';\n" +
        "/t:test/@ID";
      ResourceSet result = service.query(query);
View Full Code Here

      service.query(query);
     
      query =
        "declare namespace t='http://www.foo.com';\n" +
        "/t:test/@ID";
      ResourceSet result = service.query(query);
      assertEquals(1, result.getSize());
      assertEquals("myid", result.getResource(0).getContent().toString());
    } catch (Exception e) {
      fail(e.getMessage());
    }
View Full Code Here

            if (optimize)
                query = OPTIMIZE + query;
            else
                query = NO_OPTIMIZE + query;
            query = NAMESPACES + query;
            ResourceSet result = service.query(query);
            System.out.println("-- Found: " + result.getSize());
            return (int) result.getSize();
        } catch (XMLDBException e) {
            e.printStackTrace();
            Assert.fail(e.getMessage());
View Full Code Here

            XQueryService service = (XQueryService) testCollection.getService("XQueryService", "1.0");
            if (optimize)
                query = NAMESPACES + OPTIMIZE + query;
            else
                query = NAMESPACES + NO_OPTIMIZE + query;
            ResourceSet result = service.query(query);
            System.out.println("-- Found: " + result.getSize());
            Assert.assertEquals(message, expected, result.getSize());
        } catch (XMLDBException e) {
            e.printStackTrace();
            Assert.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.