Example usage for org.dom4j.dom DOMDocumentType DOMDocumentType

List of usage examples for org.dom4j.dom DOMDocumentType DOMDocumentType

Introduction

In this page you can find the example usage for org.dom4j.dom DOMDocumentType DOMDocumentType.

Prototype

public DOMDocumentType() 

Source Link

Usage

From source file:org.olat.ims.qti.editor.beecom.objects.QTIDocument.java

License:Apache License

/**
 * Get the structure as an XML Document.
 * //from   www  .  ja  va  2s .  c o  m
 * @return XML Document.
 */
public Document getDocument() {
    final Document tmp = DocumentHelper.createDocument();
    final DocumentType type = new DOMDocumentType();
    type.setElementName(DOCUMENT_ROOT);
    type.setSystemID(DOCUMENT_DTD);

    tmp.setDocType(type);
    final Element questestinterop = tmp.addElement(DOCUMENT_ROOT);
    this.assessment.addToElement(questestinterop);
    return tmp;
}

From source file:org.opencms.configuration.CmsConfigurationManager.java

License:Open Source License

/**
 * Creates the XML document build from the provided configuration.<p>
 * //from   w  w  w.  j  a  va2 s .co  m
 * @param configuration the configuration to build the XML for
 * @return the XML document build from the provided configuration
 */
public Document generateXml(I_CmsXmlConfiguration configuration) {

    // create a new document
    Document result = DocumentHelper.createDocument();

    // set the document type        
    DOMDocumentType docType = new DOMDocumentType();
    docType.setElementName(N_ROOT);
    docType.setSystemID(configuration.getDtdUrlPrefix() + configuration.getDtdFilename());
    result.setDocType(docType);

    Element root = result.addElement(N_ROOT);
    // start the XML generation
    configuration.generateXml(root);

    // return the resulting document
    return result;
}