Concerning (a), I think a wildcard namespace is as much a namespace as Namespace.NO_NAMESPACE, and designing a special class just for this case might be a too heavy design (i'm thinking about performances, code compactness, and ease for the JDOM user).
<br><br>For (b), I think "any namespace or none" would be more useful. It could help to be able to, for example, do this :<br><br>Element foo;<br>Namespace testNS = foo.getAttribute("bar",Namespace.ANY_NAMESPACE
).getNamespace();<br><br>and having testNS equals to Namespace.NO_NAMESPACE.<br><br>Thanks for your answers.<br><br>Kevin POCHAT<br><br><div><span class="gmail_quote">2006/7/3, Michael Kay <<a href="mailto:mike@saxonica.com">
mike@saxonica.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Searching when you only know the localName can be useful,
but a couple of observations:</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">(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.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">(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.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Michael Kay</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><a href="http://www.saxonica.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.saxonica.com/</a></font></span>
</div><br>
<blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:jdom-interest-bounces@jdom.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jdom-interest-bounces@jdom.org</a>
[mailto:<a href="mailto:jdom-interest-bounces@jdom.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jdom-interest-bounces@jdom.org</a>] <b>On Behalf Of </b>Kevin
POCHAT<br><b>Sent:</b> 03 July 2006 14:45<br><b>To:</b>
<a href="mailto:jdom-interest@jdom.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jdom-interest@jdom.org</a><br><b>Subject:</b> [jdom-interest]
Namespace.ANY_NAMESPACE<br></font><br></div></blockquote></div><div><span class="e" id="q_10c34de33db48cf5_1">
<div></div>Hi,<br><br>I'm working on an app using a DTD to generate JDOM-based
XML Parsers.<br>When I use calls to Element.getAttributeValue() I don't
necessarily know what is the namespace of the looked up
attribute.<br><br>Would it be considered as useful or as a sacrilege to
implement a static Namespace to be used as a "wildcard" namespace ? <br>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.<br><br>Thanks,
<br><br>Kevin POCHAT </span></div><div></div>
</div></blockquote></div><br>