[
https://issues.apache.org/jira/browse/WSCOMMONS-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Glen Daniels resolved WSCOMMONS-139.
------------------------------------
Resolution: Fixed
I fixed the namespace URI part of this, because it really makes no sense to
have a null URI.
The null prefix actually has meaning in the current OM design (not that you'd
know it from the JavaDoc.... :) ). When an OMNamespace is declared somewhere
with a null prefix that tells the serializer to auto-generate a prefix like
"axis2-ns1". You might question whether this is the right way to deal with
this, but it is consistent and what's there now, so I didn't change it.
I don't think "hasPrefix" is necessary since it's easy enough to just
getPrefix() and decide how to behave based on that.
Marking this fixed for now, please comment if this doesn't meet your needs.
> OMNamespace accepts any namespace URI and prefix; it's not compatible with
> QName
> --------------------------------------------------------------------------------
>
> Key: WSCOMMONS-139
> URL: https://issues.apache.org/jira/browse/WSCOMMONS-139
> Project: WS-Commons
> Issue Type: Bug
> Components: AXIOM
> Reporter: Alexander Veit
> Assigned To: Glen Daniels
>
> OMNamepace does not define a contract on namespace URIs and prefixes. So
> OMNamespace implementations accept null URIs and prefixes and return these
> values in the getNamespaceURI() and getPrefix() methods.
> This leads to errors as in org.apache.axiom.om.impl.dom.AttrImpl#getQName().
> To be compatible with javax.xml.namespace.QName I would suggest to
> - throw an IllegalArgumentException if a null namespace URI is given in an
> OMNamespace constructor,
> - throw an IllegalArgumentException if a null namespace prefix is given in an
> OMNamespace constructor and
> - to assign a constant empty String if an empty namespace prefix is given in
> an OMNamespace constructor or if a constructor without a namespace prefix
> parameter is called.
> Additionally, a hasPrefix() method could help avoiding programming errors.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]