[jdom-interest] output with namespace only on root element

tballen at copart.com tballen at copart.com
Mon Jun 9 07:26:33 PDT 2003


I am constructing a JDOM document in the "cprt" namespace.
I only want the root element to show this namespace and have all child 
elements inherit the "cprt" namespace by default.
I want the doc. to be output like this:

I create the document as follows:

	root = new Element(ROOT, cprt);
	doc = new Document(root);
	Element element = new Element(elementName, cprt);

When I use XMLOutputter to output the document all elements have the "cprt" 
namespace prefix but I only want the root element to show this.
Is this possible?
I guess I could add all child elements without a namespace but then the 
JDOM document would not be accurate.


More information about the jdom-interest mailing list