W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2008

Re: [selectors-api] Investigating NSResolver Alternatives

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sat, 12 Jul 2008 18:55:07 +0200
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Cc: public-webapps <public-webapps@w3.org>
Message-ID: <05oh74ltvj2nvkqupgtckbuchml3qe7rsl@hive.bjoern.hoehrmann.de>

* Lachlan Hunt wrote:
>Possibly.  The algorithm says:
>if ( Element's namespace != null and Element's prefix == prefix ) {
>    ...
>}
>
>Since "" == null, I guess technically that means either should be 
>supported.  But the definition of the prefix parameter states
>
>   "If this parameter is null, the method will return the default
>    namespace URI if any."
>
>So the spec is really unclear about the issue.  I suppose, if we go back 
>to the NSResolver function, I could make it pass "" instead of null 
>anyway, and then get the DOM Core spec fixed.

http://www.w3.org/TR/DOM-Level-3-Core/core.html#Namespaces-Considerations

  Applications should use the value null as the namespaceURI parameter
  for methods if they wish to have no namespace. In programming
  languages where empty strings can be differentiated from null, empty
  strings, when given as a namespace URI, are converted to null. This is
  true even though the DOM does no lexical checking of URIs.

This can't be much clearer really.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Saturday, 12 July 2008 16:55:46 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:27 GMT