Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 1st, 2006, 03:35 PM
Max
Guest
 
Posts: n/a
Default Default-default namespace and localname

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


  #2  
Old August 1st, 2006, 03:55 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: Default-default namespace and localname



Max wrote:

Quote:
- 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.
Quote:
- 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/
  #3  
Old August 1st, 2006, 05:15 PM
Joe Kesselman
Guest
 
Posts: n/a
Default Re: Default-default namespace and localname

Max wrote:
Quote:
- 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.
Quote:
- 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.
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles