Java Mailing List Archive

http://www.junlu.com/

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

RE: [jdom-interest] Namespace.ANY_NAMESPACE

Michael Kay

2006-07-03

Replies:

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
http://www.saxonica.com/


From: jdom-interest-bounces@jdom.org [mailto:jdom-interest-bounces@jdom.org] On Behalf Of Kevin POCHAT
Sent: 03 July 2006 14:45
To: jdom-interest@jdom.org
Subject: [jdom-interest] Namespace.ANY_NAMESPACE

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
_______________________________________________
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.