I am trying to build the following XML structure:
<EDIOrderPackage xmlns="urn:URI" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0.0.0</Version>
<Test>true</Test>
</EDIOrderPackage>
I use JDOM2 and don't know how to add 2 Namespaces!
Even if I set only one Namespace the result is not the same as I wish it to be.
If I set the Namespace by root.setNamespace()
and use the 2nd one with the prefix i it looks like this:
<i:EDIOrderPackage mlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0.0.0</Version>
<Test>true</Test>
<i:/EDIOrderPackage>
So there is an i before the EDIPOrderPackage.
If i dont use a prefix is looks like this:
<EDIOrderPackage xmlns="urn:URI">
<Version xmlns="">1.0.0.0</Version>
<Test xmlns="">true</Test>
</EDIOrderPackage>
If if try to add it as attributes, it throws the error message that I cannot an attribute with the name "xmlns"
So how can I build an XML with JDOM looking like the one above?