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]
Back to basics: a few questions about colons in XML names

Hi Folks,

According to the XML specification, a tag name can contain a colon [1]. Thus, this is a legal tag name:

    ex:Comment

Here is a simple XML instance document containing that tag name:

------------------------------------------
<?xml version="1.0"?>
<root>
    <ex:Comment>Hello World</ex:Comment>
</root>
------------------------------------------

When I checked the document for well-formedness I got this error:

   The prefix "ex" for element "ex:Comment" is not bound.


The XML specification also says this [2]: 

     The Namespaces in XML Recommendation [XML Names] assigns a meaning 
     to names containing colon characters. Therefore, authors should not 
     use the colon in XML names except for namespace purposes, but XML 
     processors must accept the colon as a name character.

The following questions concern the relationship between an XML processor and the task of checking that each namespace prefix is bound to a namespace. 


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?

2. Are there XML processors that are namespace-unaware? That is, are there XML processors that treat colons as just another character? 

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

4. When we talk about an "XML processor" do we really mean XML processor + namespace processor"?

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?

6. If the ex in <ex:Comment> is not bound to a namespace, is that really an XML well-formedness error?


/Roger

[1] Tag names: http://www.w3.org/TR/REC-xml/#sec-starttags 

[2] Note about colons in tag names: http://www.w3.org/TR/REC-xml/#sec-common-syn 


[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