W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > May 2011

Re: Reserved XML names and namespaces

From: Jirka Kosek <jirka@kosek.cz>
Date: Thu, 12 May 2011 19:54:24 +0200
Message-ID: <4DCC1ED0.1070803@kosek.cz>
To: michael.schaefer@destatis.de
CC: liam@w3.org, public-xml-core-wg@w3.org
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:43 UTC