Archive for the ‘XML’ Category

jDom: Converting from JDOM to DOM

Saturday, January 24th, 2009
public org.w3c.dom.Document convertToDOM(org.jdom.Document jdomDoc)
     throws JDOMException {

     DOMOutputter outputter = new DOMOutputter();
     return outputter.output(jdomDoc);
}

public org.w3c.dom.Element convertToDOM(org.jdom.Element jdomElement)
     throws JDOMException {
     DOMOutputter outputter = new DOMOutputter();
     return outputter.output(jdomElement);
}

public org.w3c.dom.Attr convertToDOM(org.jdom.Document jdomAttribute)
     throws JDOMException {
     DOMOutputter outputter = new DOMOutputter();
     return outputter.output(jdomAttribute);
}

Source: Tip: Converting from JDOM