Presumably you saw my subsequent message. The official javadoc for
getNamespaceURI is amazingly misleading. The DOM tree I was looking did, in
fact, have no namespaces at all, due to the extremely confusing classpath
snafu with JAX-B.

My remarks about NamespaceContext remain.

On Tue, Sep 7, 2010 at 2:00 PM, Daniel Kulp <[email protected]> wrote:

> On Saturday 04 September 2010 8:10:35 am Benson Margulies wrote:
> > I've just noticed two traps waiting to bite CXF developers.
> >
> > 1. The MapNamespaceContext does not implement the rules for 'xml' and
> > 'xmlns'.
> >
> > 2. The DOMUtils seems to me to be rather confused between the effective
> > namespace of an element and the declared namespace of an element.
> >
> > In a document like:
> >
> > <?xml version="1.0" encoding="UTF-8" standalone="no"?><doc
> > xmlns="urn:some-namespace"><ele xmlns=""/></doc>
> >
> > Node.getNamespaceURI() can return null for that inner element.
>
> Isn't that correct?   That said, I do hate a bunch of things about the DOM
> api
> with default namespaces and such.   Some require null, others accept the
> empty
> string, etc...   In general, Stax is the same way.  That's why there are a
> lot
> of StringUtils.isEmpty(str) type calls and such to map things semi
> consistently.
>
> That said, for the most part, I hate much of DOMUtils as well.  For any
> parsing things, I've been trying to switch things over to the StaxUtils.
> I'd
> like DOMUtils to just be a few of the generic DOM lookup things.
>
> > I don't think we're calling most of the stranger functions in here.
> Absent
> > objections, I will remove questionable functions which are never called.
>
> Please do.
>
> --
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog
>

Reply via email to