![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Are there standard namespaces that don't need URIs? [Thread Next] Re: Are there standard namespaces that don't need URIs?To: NULL Date: 2/3/2007 7:31:00 AM "Grant Robertson" <bogus@b...> wrote in message news:MPG.202dc3e4aad002db9896f8@n...... > As I am learning about XML I seen that xmlns is used with a colon after > it as if it were a namespace itself. However, I have never seen a URI > given for it. Is "xmlns" a sort of predefined word in that all XML > software just knows what it means without it needing a URI? > > Are there any more of these special words that need no definition within > any schema? I know there are other special words like "element" and > "targetNamespace" but these seem to be defined within the XML Schema > schema definition. It seems that only "xmlns" must be known before > anything else can be known. > > Am I totally missing the boat on this or what? First of all, any namespace "needs" (has) a namespace-uri. What you are asking here is not namespaces that don't have uri-s, but *reserved prefixes*, that must always be associated with specific namespace-uri-s There are two such reserved prefixes (xml and xmlns) and they are listed in the Namespaces specification (http://www.w3.org/TR/xml-names/#sec-namespaces): "Namespace constraint: Reserved Prefixes and Namespace Names The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/namespace. It MAY, but need not, be declared, and MUST NOT be bound to any other namespace name. Other prefixes MUST NOT be bound to this namespace name, and it MUST NOT be declared as the default namespace. 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 . Other prefixes MUST NOT be bound to this namespace name, and it MUST NOT be declared as the default namespace. Element names MUST NOT have the prefix xmlns. All other prefixes beginning with the three-letter sequence x, m, l, in any case combination, are reserved. This means that: a.. users SHOULD NOT use them except as defined by later specifications b.. processors MUST NOT treat them as fatal errors. Though they are not themselves reserved, it is inadvisable to use prefixed names whose LocalPart begins with the letters x, m, l, in any case combination, as these names would be reserved if used without a prefix. " So, when using a global attribute like xml:space, one doesn't need to define the prefix "xml" -- it is known to the parser. Cheers, Dimitre Novatchev | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
