sshyran / genxdm

Automatically exported from code.google.com/p/genxdm
0 stars 0 forks source link

Should null be permitted to equal "" for namespace URIs? #44

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We have a *lot* of places where we ask for a namespace + name. As a rule, we 
never permit null for the namespace URI.  This means that the user of the API 
must type: "" (short form, and not particularly obvious) or 
XMLConstants.NULL_NS_URI (long form, identifying exactly what's going on) 
whenever the namespace is ... well, "" (default global namespace).

This is particularly odious for attributes.  Note that it's bad practice to 
encourage people to use ""; simple as it is, it's not hard to make a mistake 
("'", " "), and even a smart IDE won't catch it.  So we'd be encouraging them 
to use the longer form, which is ... well, silly-verbose.  It's natural for 
folks to want to say "null", which is something that the IDE and compiler will 
at least enforce to be spelled correctly.  Some bridges (like Cx, for instance) 
are forgiving, and transform null (when supplied as the namespace uri) to "".

Should we mandate that bridges should do so for navigation and information 
methods?  Note that null means something *different* for the "matches" methods 
(it's the wild card).  Also note that permitting null suggests that "null" is 
the value that will be returned when you ask something for its namespace-uri, 
and it never is.  

Original issue reported on code.google.com by aale...@gmail.com on 25 Jan 2011 at 3:39

GoogleCodeExporter commented 8 years ago
"Be lenient in what you accept, and strict in what you produce."

Yes, I think we should allow null for input as an alias for "".  I don't think 
this suggests that null will be output upon return.

This does create some possible confusion with the matching methods, but I think 
that's OK.

Original comment by eric%tib...@gtempaccount.com on 25 Jan 2011 at 5:25

GoogleCodeExporter commented 8 years ago
Kind of annoying, but whatever we do for 1.0, that's what we should stick with. 
Therefore, this ought to be in 1.0

Original comment by aale...@gmail.com on 26 Jul 2012 at 7:51

GoogleCodeExporter commented 8 years ago
defer

Original comment by aale...@gmail.com on 24 Oct 2013 at 5:25