Example usage for org.jdom2 Element getNamespacesIntroduced

List of usage examples for org.jdom2 Element getNamespacesIntroduced

Introduction

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

Prototype

@Override
    public List<Namespace> getNamespacesIntroduced() 

Source Link

Usage

From source file:ca.nrc.cadc.xml.JsonOutputter.java

License:Open Source License

private boolean writeSchemaAttributes(Element e, PrintWriter w, int i) throws IOException {
    boolean ret = false;

    // getNamespacesIntroduced: only write for newly introduced namespaces;
    // this correctly handles the current context of namespaces from root to 
    // current element
    for (Namespace ans : e.getNamespacesIntroduced()) {
        String uri = ans.getURI();
        String pre = ans.getPrefix();
        if (ret) {
            w.print(",");
        }//w  w  w  . j  a  v a  2s. c o  m
        ret = true;
        indent(w, i);
        writeSchema(uri, pre, w);
    }
    return ret;
}