SAXOMBuilder needs to support default namespaces
------------------------------------------------
Key: WSCOMMONS-373
URL: https://issues.apache.org/jira/browse/WSCOMMONS-373
Project: WS-Commons
Issue Type: Bug
Components: AXIOM
Environment: All
Reporter: Michael Heemskerk
Priority: Minor
It is impossible to create elements with the SAXOMBuilder that use a default
namespace. The startPrefixMapping method always calls
OMElement.declareNamespace, even when the provided prefix is "" or null.
OMElement in turn creates a prefix "axis2ns1".
This is an issue when using a Castor mapping file in combination with
spring-oxm.
A possible fix to this issue would be to change the startPrefixMapping method
to call OMElement.declareDefaultNamespace when the provided prefix is null or
"", e.g.
public void startPrefixMapping(String prefix, String uri)
throws SAXException {
if (nextElem == null)
nextElem = createNextElement(null);
if (null == prefix || "".equals(prefix)) {
nextElem.declareDefaultNamespace(uri);
} else {
nextElem.declareNamespace(uri, prefix);
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.