469,649 Members | 1,400 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,649 developers. It's quick & easy.

Default-default namespace and localname

Max
Hello everyone!

I have 2 questions:
- Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an
empty string("")?
- Is the localname property for element without prefix the name of element
(localName = nodeName) or an empty string("")?

Thanks,

Max
Aug 1 '06 #1
2 1247


Max wrote:

- Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an
empty string("")?
The namespace with namespace URI http://www.w3.org/2000/xmlns/ is
predefined for xmlns declarations, see
<http://www.w3.org/XML/xml-names-19990114-erratawhich says:
"The prefix xmlns is used only to declare namespace bindings and is
by definition bound to the namespace name http://www.w3.org/2000/xmlns/.
It must not be declared. No other prefix may be bound to this namespace
name."

I don't know what "default-default" namespace is supposed to be, if no
default namespace is declared using xmlns="someURI" then elements are in
no namespace if they don't have a prefix in their name.
- Is the localname property for element without prefix the name of element
(localName = nodeName) or an empty string("")?
Well it depends on the object model/standard/implementation but for the
W3C DOM Level 2 Core in a namespace aware implementation the localName
then is the same as the nodeName.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 1 '06 #2
Max wrote:
- Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an
empty string("")?
If you do not define a default namespace (or if you undefine the default
namespace by assigning "" to it), the default is "no namespace". (Empty
string is not a legal namespace URI, it's just how XML expresses "no
namespace"). Whether that shows up as empty string or null or something
else depends on which API you're using to access the document's contents.
- Is the localname property for element without prefix the name of element
(localName = nodeName) or an empty string("")?
Per the XML Infoset, if an element is not bound to a namespace it has no
localname. Again, it's up to the API you're using to decide how to tell
you this.
Aug 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ayende Rahien | last post: by
2 posts views Thread by Ayende Rahien | last post: by
1 post views Thread by Jack Colletta | last post: by
2 posts views Thread by james.cssa | last post: by
1 post views Thread by Clive Dixon | last post: by
22 posts views Thread by Luna Moon | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.