Package org.xmldb.api.base

Examples of org.xmldb.api.base.ResourceIterator.nextResource()


            IncludeXMLConsumer includeHandler = new IncludeXMLConsumer(handler);

            // Print search results
            ResourceIterator results = resultSet.getIterator();
            while (results.hasMoreResources()) {
                XMLResource result = (XMLResource)results.nextResource();

                final String id = result.getId();
                final String documentId = result.getDocumentId();

                attributes.clear();
View Full Code Here


           
            ResourceSet resultSet = service.query(querystring);
            results = resultSet.getIterator();
           
            while (results.hasMoreResources() ) {
                XMLResource resource = (XMLResource)results.nextResource();
                String documentstr = (String)resource.getContent();
                System.out.println(documentstr);
            }
           
        } catch (Exception e) {
View Full Code Here

        // Create an XObject to be used in Xpath query
        xo = new XObject();

        // Retrieve the next node
        XMLResource resource = (XMLResource) results.nextResource();

        originalnode = resource.getContentAsDOM();

      }
      catch (Exception e) {
View Full Code Here

            IncludeXMLConsumer includeHandler = new IncludeXMLConsumer(handler);

            // Print search results
            ResourceIterator results = resultSet.getIterator();
            while (results.hasMoreResources()) {
                XMLResource result = (XMLResource)results.nextResource();

                final String id = result.getId();
                final String documentId = result.getDocumentId();

                attributes.clear();
View Full Code Here

            ResourceSet resultSet = service.query(querystring);
            results = resultSet.getIterator();

            while (results.hasMoreResources()) {
                XMLResource resource = (XMLResource) results.nextResource();
                String documentstr = (String) resource.getContent();
                System.out.println(documentstr);
            }

        } catch (Exception e) {
View Full Code Here

      XPathQueryService service = (XPathQueryService) collection.getService("XPathQueryService", "1.0");
      ResourceSet resourceSet = service.query(xpath);
      ResourceIterator resourceIterator = resourceSet.getIterator();

      while (resourceIterator.hasMoreResources()) {
        Resource resource = resourceIterator.nextResource();
        System.out.println((String) resource.getContent());
      }
    }
    catch (XMLDBException e) {
      System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
View Full Code Here

   public void testIterate()
         throws Exception {
      ResourceIterator iterator = new ResourceIteratorImpl(vct);

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(true, iterator.hasMoreResources());
View Full Code Here

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(false, iterator.hasMoreResources());
View Full Code Here

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(false, iterator.hasMoreResources());
      try {
         iterator.nextResource();
         fail();
View Full Code Here

      assertEquals(true, iterator.hasMoreResources());
      assertNotNull(iterator.nextResource());

      assertEquals(false, iterator.hasMoreResources());
      try {
         iterator.nextResource();
         fail();
      } catch (XMLDBException e) {
         return;
      }
   }
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.