Example usage for org.dom4j.tree DefaultDocument add

List of usage examples for org.dom4j.tree DefaultDocument add

Introduction

In this page you can find the example usage for org.dom4j.tree DefaultDocument add.

Prototype

public void add(Element element) 

Source Link

Usage

From source file:org.olat.ims.cp.objects.CPManifest.java

License:Apache License

/**
 * @param doc/*from   w w  w. ja v a 2 s  .  c o m*/
 */
public void buildDocument(final DefaultDocument doc) {
    // Manifest is the root-node of the document, therefore we need to pass the
    // "doc"
    final DefaultElement manifestElement = new DefaultElement(CPCore.MANIFEST);

    manifestElement.add(new DefaultAttribute(CPCore.IDENTIFIER, this.identifier));
    manifestElement.add(new DefaultAttribute(CPCore.SCHEMALOCATION, this.schemaLocation));
    // manifestElement.setNamespace(this.getNamespace()); //FIXME: namespace

    doc.add(manifestElement);

    if (metadata != null) {
        metadata.buildDocument(manifestElement);
    }
    organizations.buildDocument(manifestElement);
    resources.buildDocument(manifestElement);

}