Searching when you only know the localName can be useful,
but a couple of observations:
(a) your proposed object (the wildcard) is not a Namespace,
so it is wrong to model it as one. Correct design would change the method to
accept a "NamespaceTest" object which could be either a Namespace or a
NamespaceWildcard.
(b) you need to think carefully about whether you want to
match "any namespace", or "any namespace or none". Remember that technically,
(and very inconveniently) unqualified attribute names are not in any namespace:
it's wrong to refer to them as being in some default, unnamed, or null
namespace.
Michael Kay
Hi,
I'm working on an app using a DTD to generate JDOM-based
XML Parsers.
When I use calls to Element.getAttributeValue() I don't
necessarily know what is the namespace of the looked up
attribute.
Would it be considered as useful or as a sacrilege to
implement a static Namespace to be used as a "wildcard" namespace ?
If
useful, do you have any guidlines concerning various points to take care of
during such a development ? I currently just set it to be taken in
consideration in the Namespace.equals(Object ob) method.
Thanks,
Kevin POCHAT