XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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 XMLnames

These would get rejected because of the namespaces spec, which allow element (and attribute) names to be a QName, i.e. an optional prefix-with-colon followed by an NCName ("no colon name"). So that allows at most one colon.

Evan

--
Evan Lenz
Lenz Consulting Group, Inc.
http://lenzconsulting.com
+1 (360) 297-0087


On 11/8/10 12:26 PM, Stephen Green wrote:
AANLkTik_niS137RDPiTQHfv2_L6qhg92x-8gTuEkuFd9@mail.gmail.com" type="cite">
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"?>
<root>
   <a:b:ex:Comment>Hello World</a:b:ex:Comment>
</root>
 
More curious perhaps would be a double-colon
<?xml version="1.0"?>
<root>
   <ex::Comment>Hello World</ex::Comment>
</root>
 
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>
</root>

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:
QUESTIONS:

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

-- 
Evan Lenz
Lenz Consulting Group, Inc.
http://lenzconsulting.com
+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