Re: [xmljs-users] Namespace validation question
Brought to you by:
djoham,
witchhunter
From: Ilya B. <il...@dr...> - 2009-04-07 17:13:29
|
Dmitry, Thanks for the quick reply. Perhaps I am not reading the spec correctly. To me, "It MAY, but need not, be declared..." Means that not declaring the namespace explicitly should be OK. And if I am wrong about this, what would be the correct way to re-write the following tag so that the xml:lang attribute namespace validates? <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en"/> Thanks, Ilya Dmitry Khudorozhkov wrote: > Hi Ilya, > > >> Why does the namespaceURI have to be set to >> "http://www.w3.org/XML/1998/namespace" if the prefix is "xml"? >> > > Because XML namespace specification says so: > > http://www.w3.org/TR/REC-xml-names/ > > "3 Declaring Namespaces > > ... > > 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." > > Hope it answers your question, > Dmitry. > > > > |