Example usage for org.jdom2 Element addNamespaceDeclaration

List of usage examples for org.jdom2 Element addNamespaceDeclaration

Introduction

In this page you can find the example usage for org.jdom2 Element addNamespaceDeclaration.

Prototype

public boolean addNamespaceDeclaration(final Namespace additionalNamespace) 

Source Link

Document

Adds a namespace declarations to this element.

Usage

From source file:pt.ist.socialsoftware.edition.visitors.TEIGenerator.java

License:Creative Commons License

private Element generateCorpus() {
    jdomDoc = new Document();
    Element rootElement = new Element("teiCorpus");

    rootElement.setNamespace(xmlns);/*from  www .  ja  va  2s .  c  o m*/

    rootElement.addNamespaceDeclaration(Namespace.getNamespace("svg", "http://www.w3.org/2000/svg"));

    rootElement.addNamespaceDeclaration(Namespace.getNamespace("xi", "http://www.w3.org/2001/XInclude"));

    jdomDoc.setRootElement(rootElement);
    return rootElement;
}

From source file:se.miun.itm.input.model.design.Design.java

License:Open Source License

private Element initEmptyRoot(String expId) throws InPUTException {
    Element root = new Element(Q.DESIGN_ROOT, Q.DESIGN_NAMESPACE);
    root.addNamespaceDeclaration(Q.SCHEMA_INSTANCE_NAMESPACE);
    root.setAttribute(Q.SCHEMA_LOCATION_ATTR, Q.getSchemaLocation(), Q.SCHEMA_INSTANCE_NAMESPACE);
    root.setAttribute(Q.ID_ATTR, expId);

    if (ps.getDesignSpace().isFile()) {
        root.setAttribute(Q.REF_ATTR, ps.getDesignSpace().getFileName());
    }/*from  w w  w.j a  v  a2  s.  co m*/
    return root;
}