OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   namespace URI of xmlns prefix

[ Lists Home | Date Index | Thread Index ]

Hi,

Could someone clarify part of the XML Namespaces spec for me?

The spec states that namespace declarations are a special category of 
attribute: "A namespace is *declared* using a family of reserved 
attributes. Such an attribute's name must either be |xmlns| or have 
|xmlns:| as a prefix".

So if a namespace declaration like 
xmlns:foo="http://www.foo.com/some.namespace"; is made, and that 
declaration is considered a type of attribute, then:

- the namespace prefix of the attribute is "xmlns"
- the local name of the attribute is "foo"
- the value of the attribute is "http://www.foo.com/some.namespace";

But what is the namespace URI of the attribute? What namespace does the 
prefix "xmlns" belong to?

And then you have default namespace declarations, such as 
xmlns="http://www.foo.com/some.namespace";.

- the namespace prefix of the attribute is an empty string: ''
- the local name of the attribute is "xmlns"
- the value of the attribute is "http://www.foo.com/some.namespace";

And I presume in this case, the namespace URI would be an empty string?

I'm asking because I'm unsure how a DOM method like getAttributeNS is 
supposed to deal with namespace declarations. Would xmlns attributes 
simply be ignored in this case?

John Heinstein

-- 
John Heinstein
VP Software Development
Engage Interactive
921 College Hill Rd.
Fredericton, NB
E3B 6Z7

phone: (506) 460-1627
fax: (506) 460-1626

http://www.engageinteractive.com





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS