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


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Back to basics: a few questions about colons in XML names

How about several colons being allowed in an element name?
The XML spec seems to permit it as XML but is it expressly
disallowed for namespaces?
<?xml version="1.0"?>
   <a:b:ex:Comment>Hello World</a:b:ex:Comment>
More curious perhaps would be a double-colon
<?xml version="1.0"?>
   <ex::Comment>Hello World</ex::Comment>
Does the double colon mean it gets past the requirements for
namespaces or that it gets rejected because of the namespace
spec? Or, on the other hand, is it permitted for a prefix to
contain one or more colons?
<?xml version="1.0"?>
<root xmlns:ex:="abc">
   <ex::Comment>Hello World</ex::Comment>

Best regards

Stephen D Green

On 8 November 2010 19:40, Evan Lenz <evan@evanlenz.net> wrote:
See below.

On 11/8/10 10:27 AM, Costello, Roger L. wrote:

1. Are all XML processors namespace-aware? That is, do all XML processors understand the colon in a name as a delimiter between a namespace prefix and a local name?
By definition, no. In practice, I hope so.
2. Are there XML processors that are namespace-unaware? That is, are there XML processors that treat colons as just another character?
Maybe, but you shouldn't use them.
3. Is namespace checking (checking that each prefix is bound to a namespace) a separate activity from XML checking? Is there such a thing as a namespace processor? If so, are XML instance documents first checked by an XML processor and then by a namespace processor:

XML instance document -->  XML processor -->  namespace processor
No, namespaces were retroactively grafted into the XML 1.0 foundation. They're not properly layered (as perhaps they should have been).
4. When we talk about an "XML processor" do we really mean XML processor + namespace processor"?
In practice, yes.
5. Consider the task of checking that "ex:" is bound to a namespace. Is that an XML processor task? Or, is that a task for a higher-level application; e.g., a namespace processor?

Yes, it's the namespace-aware processor's task. Not a higher-level concern.
6. If the ex in<ex:Comment>  is not bound to a namespace, is that really an XML well-formedness error?

Not technically. But you might say it's not "namespace-well-formed". And, actually, I just checked and there's a reason I used that phrase: http://www.w3.org/TR/xml-names/#dt-nwf


Evan Lenz
Lenz Consulting Group, Inc.
+1 (360) 297-0087

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

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

Copyright 1993-2007 XML.org. This site is hosted by OASIS