Package org.xmldb.api.base

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


            try {
                // get each result
                ResourceIterator ri = resources.getIterator();
                while (ri.hasMoreResources()) {
                    XMLResource res = (XMLResource)ri.nextResource();
                    // get the result's document name (the query result just contains content as selected by the xpath query)
                    String id = res.getDocumentId();
                    log.trace("Query matched document: " + IdToName(id));
                    Document policyDoc = m_policyReader.readPolicy(((String)m_collection.getResource(id).getContent()).getBytes("UTF-8"));
                    documents.put(IdToName(id), handleDocument(policyDoc, policyFinder));
View Full Code Here


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

            while (results.hasMoreResources()) {
                XMLResource resource = (XMLResource) results.nextResource();
                String documentstr = (String) resource.getContent();
                System.out.println(documentstr);
            }
        } finally {
            if (col != null) {
View Full Code Here

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

            while (results.hasMoreResources()) {
                XMLResource resource = (XMLResource) results.nextResource();
                String documentstr = (String) resource.getContent();
                System.out.println(documentstr);
            }
        } finally {
            if (col != null) {
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());
        } finally {
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

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.