Example usage for org.dom4j.dom DOMDocumentType setSystemID

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

Introduction

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

Prototype

public void setSystemID(String systemID) 

Source Link

Document

Sets the system ID of the document type

Usage

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

License:Open Source License

/**
 * Creates the XML document build from the provided configuration.<p>
 * // w  w w . ja  va2  s.c  om
 * @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;
}