Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] Namespace.ANY_NAMESPACE

Jason Hunter

2006-07-05

Replies:

> When I use calls to Element.getAttributeValue() I don't necessarily know
> what is the namespace of the looked up attribute.

For now, you might want to use getAttributes() and do a little manual
iteration. Maybe write a utility method.

Once upon a time a null namespace would mean to match any, but I don't
think that's in place anymore.

> Would it be considered as useful or as a sacrilege to implement a static
> Namespace to be used as a "wildcard" namespace ?

I think I'd prefer to avoid opening up the namespace can of worms unless
we had a really compelling reason. :)

A wildcard esp would be a pain because it would have to be rejected for
use as a normal namespace, one that's attached to nodes. You can't
construct an element with ANY, for example. This is why Michael's
approach of a separate type would be better. But that's a lot of mess
for something that could be done with a little iteration. (Iteration
isn't even slower, as it's what's done internally, because attribute
lists are assumed short.)

-jh-
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.