[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Back to basics: a few questions about colons in XML names

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Mon, 8 Nov 2010 13:27:13 -0500

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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.