Given this code:
OMDOMFactory factory = new OMDOMFactory();
OMElement element = factory.createOMElement("name", "ns", null);
I expected this output:
This was the actual output:
<name xmlns:generatedNamespace="ns" xmlns="ns"/>
While the generated element is within the expected namespace, the output's use of a default namespace where none is necessary is a problem, particularly if you wish to use prefixed elements as frequently as possible. In fact, the generated prefix may never be used as long as the default is available.
This problem can be ameliorated in two lines of counter-intuitive code:
OMNamespace ns = element.findNamespace("ns", null);
After running those additional lines of code, the output will match the expectation, but that code is hard to justify.
This bug was observed in: OMDOMFactory, DOMSOAPFactory, SOAP11Factory (dom), SOAP12Factory (dom).
This bug does not occur in: OMLinkedListImplFactory, SOAP11Factory (llom), SOAP12Factory (llom).