Example usage for org.jdom2 Namespace XML_NAMESPACE

List of usage examples for org.jdom2 Namespace XML_NAMESPACE

Introduction

In this page you can find the example usage for org.jdom2 Namespace XML_NAMESPACE.

Prototype

Namespace XML_NAMESPACE

To view the source code for org.jdom2 Namespace XML_NAMESPACE.

Click Source Link

Document

Define a Namespace for the standard xml prefix.

Usage

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

License:Creative Commons License

private void generateTranscription(Element parentElement, Fragment fragment,
        Set<FragInter> fragInterSelectedSet) {

    Element textElement = new Element("text", xmlns);
    parentElement.addContent(textElement);

    Element bodyElement = new Element("body", xmlns);
    textElement.addContent(bodyElement);

    Element divElement = new Element("div", xmlns);
    bodyElement.addContent(divElement);/*from  w w  w . j av a2s .c o  m*/

    Attribute iddiv = new Attribute("id", fragment.getXmlId() + ".TEXT", Namespace.XML_NAMESPACE);
    divElement.setAttribute(iddiv);

    writer = new TEITextPortionWriter(divElement, fragInterSelectedSet);
    // writer.visit((AppText) fragment.getTextPortion());
    AppText app = (AppText) fragment.getTextPortion();
    RdgText rdg = (RdgText) app.getFirstChildText();

    if (rdg.getFirstChildText() instanceof ParagraphText)
        writer.visit((ParagraphText) rdg.getFirstChildText());
    else if (rdg.getFirstChildText() instanceof PbText)
        writer.visit((PbText) rdg.getFirstChildText());

}