[jdom-interest] XMLOutputter insers blank xmlns=""

Li Xu Lxu at copyright.com
Tue Jul 23 11:10:20 PDT 2002


Can someone tell me what I'm doing wrong here?

I have an Element object that looks like:


Then I added namespace stuff to <level1> using addNamespaceDeclaration() etc. So it becomes:

<level1 xmlns="http://my.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://my.com">

Then I constructed a Document object using this element as root. When I use XMLOutputter.outputString(dom), it's giving me <level2> as:

	<level2 xmlns="">

I can see that the string output for <level1> and <level3> are exactly as I wanted. So why it is trying to set an empty namespace for <level2>?

Thanks a lot!

More information about the jdom-interest mailing list