Example usage for org.jdom2 Document toString

List of usage examples for org.jdom2 Document toString

Introduction

In this page you can find the example usage for org.jdom2 Document toString.

Prototype

@Override
public String toString() 

Source Link

Document

This returns a String representation of the Document, suitable for debugging.

Usage

From source file:eu.himeros.cophi.ocr.proofreader.controller.pojo.HocrDocumentExistLoader.java

License:Open Source License

@Override
public Document load(Map<String, Object> origin) {
    try {//from  w  ww .j  a  va 2  s.c  o  m
        //String library = origin.get("library");
        //String book = library + "/" + origin.get("book");
        //String page = origin.get("page");
        //String login = origin.get("login");
        //String password = origin.get("password");
        //Database database = (Database) (Class.forName("org.exist.xmldb.DatabaseImpl").newInstance());
        //DatabaseManager.registerDatabase(database);
        //Collection col = DatabaseManager.getCollection(book, login, password);
        Collection libCol = (Collection) origin.get("library");
        Collection bookCol = libCol.getChildCollection((String) origin.get("book"));
        XMLResource res = (XMLResource) bookCol.getResource((String) origin.get("page"));
        DOMBuilder domBuilder = new DOMBuilder();
        Document doc = domBuilder.build((org.w3c.dom.Document) res.getContentAsDOM());
        System.err.println(doc.toString());
        System.err.println("nothing");
        //col.close();
        return doc;
    } catch (Exception ex) {
        return null;
    }
}

From source file:org.fnppl.opensdx.dmi.FeedValidator.java

License:Open Source License

public String validateOSDX_0_0_1(Feed f) { //validate against oSDX 0.1.0 (mayor minor sub)
    org.fnppl.opensdx.xml.Document doc = org.fnppl.opensdx.xml.Document.buildDocument(f.toElement());
    return validateOSDX_0_0_1(doc.toString());
}

From source file:uk.co.platosys.boox.core.Boox.java

License:Open Source License

/**
 * This takes an org.jdom.Document argument instead of a java.io.File, but
 * does the same thing.// w ww.j  av a  2 s.c  om
 *
 * @param clerk
 * @param document
 * @throws BooxException
 * @throws PermissionsException
* @throws BooxXMLException 
 */
public static void createLedgersAndAccounts(Enterprise enterprise, Clerk clerk, Document document)
        throws BooxException, PermissionsException, BooxXMLException {
    Element rootElement = document.getRootElement();
    Element ledgersElement = rootElement.getChild(LEDGERS_ELEMENT_NAME, ns);
    if (ledgersElement == null) {
        throw new BooxXMLException("ledgers schema docs faulty, no ledgers element");
    }
    if (ledgersElement.getNamespace() != ns) {
        throw new BooxXMLException("wrong namespace in schema documents");
    }

    logger.log("creating ledgers and accounts for " + enterprise.getName() + " from template document "
            + document.toString());
    createLedgersAndAccounts(enterprise, clerk, ledgersElement,
            openLedger(enterprise, Ledger.ROOT_LEDGER_NAME, clerk));

    Element tasksElement = rootElement.getChild(TASKS_ELEMENT_NAME, ns);
    if (tasksElement != null) {
        createTasks(enterprise, clerk, tasksElement);
    } //no requirement for a tasks element.
}