Re: Reserved XML names and namespaces

Michael Schäfer wrote:

> To me, it is unclear wether or not that rule applies to XML names
> defined in an XML namepace.
> 
> I'd appreciate any clarification or helpful pointers on that subject.

Hi,

my personal opinion (not representing XML Core WG) is that namespaced
elements with local names starting with "xml" are forbidden (or more
precisely reserved for future use). Production rule [4] in XML
Namespaces spec says that NCName must conform to XML Name minus ":". And
XML spec says:

"[Definition: A Name is an Nmtoken with a restricted set of initial
characters.] Disallowed initial characters for Names include digits,
diacritics, the full stop and the hyphen.

Names beginning with the string "xml", or with any string which would
match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization
in this or future versions of this specification."

Another supportive argument is that if your elements have localname
starting with "xml" you will not be able to use default namespace
because resulting syntax will be clearly not conforming to XML spec.

There were similar cases in past. For example early drafts of DocBook
V5.0 schema used <xmltag> which has to be changed to <tag> to maintain
conformance with XML and XML Namespaces specifications. Also please note
that there are some XML tools which will choke on elements starting with
"xml". So it is really bad idea to use such named elements in your
document type.

Regards,

     Jirka


-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------

Received on Thursday, 12 May 2011 17:57:24 UTC