Examples of ResourceSet


Examples of org.xmldb.api.base.ResourceSet

    // search all records whose last name begins with 'ith'
    String query = "//person[(string-length(//person/last) >= 4) and (substring(//person/last, 2)='mith')]";

    Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
    XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0");
    ResourceSet resultSet = xpathservice.query(query);

    ResourceIterator results = resultSet.getIterator();
    List res = asList(results);
    assertEquals(2, res.size());
  }
View Full Code Here

Examples of org.xmldb.api.base.ResourceSet

  {
    String query = "//person[age > 25]";

    Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
    XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0");
    ResourceSet resultSet = xpathservice.query(query);

    ResourceIterator results = resultSet.getIterator();
    List res = asList(results);
    assertEquals(1, res.size());
  }
View Full Code Here

Examples of org.xmldb.api.base.ResourceSet

  {
    String query = "//person[first='John' and last='Smith']/first/text()";

    Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
    XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0");
    ResourceSet resultSet = xpathservice.query(query);

    assertEquals(1L, resultSet.getSize());
    assertEquals("John", resultSet.getResource(0).getContent());
  }
View Full Code Here

Examples of org.xmldb.api.base.ResourceSet

  {
    String query = "//person/first/text()";

    Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
    XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0");
    ResourceSet resultSet = xpathservice.query(query);

    ResourceIterator results = resultSet.getIterator();

    List res = asList(results);
    assertEquals(2, res.size());
  }
View Full Code Here

Examples of org.xmldb.api.base.ResourceSet

    Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
    XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0");
    xpathservice.setNamespace("h", "http://example.net/person");

    ResourceSet resultSet = xpathservice.query(query);

    ResourceIterator results = resultSet.getIterator();
    List res = asList(results);
    assertEquals(1, res.size());

    XMLResource resource = (XMLResource) resultSet.getResource(0);

    // ensure that the resource has the correct doc id.
    assertEquals("doc3", resource.getDocumentId());

    Node node = resource.getContentAsDOM();
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.