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

RE: Lesson Learned: Use namespaces for both markup anddata

  • From: Amelia A Lewis <amyzing@talsever.com>
  • To: "Costello, Roger L." <costello@mitre.org>
  • Date: Tue, 11 Aug 2009 14:56:20 -0400

RE:  Lesson Learned: Use namespaces for both markup anddata
On Tue, 11 Aug 2009 14:40:39 -0400, Costello, Roger L. wrote:
>> Things get nasty when people start using QNames for everything
> How do things get nasty? What is the technical problem with QNames?

Resolving prefixes.

If there's any chance of the information being removed from context, 
the QNames can turn into garbage.

If you compare the QNames a:data and b:data, are they the same?  If you 
compare the QNames a:data and a:data are they the same?  What about 
data and data (default prefix)?

So, instead of keeping your data localized, by introducing QNames in 
context, you're introducing an indirect dependency on the structure of 
the document in which the data is contained.  When you go to grab it, 
you'd better hope you grab all the necessary bits of context.

So what does it win you?  Shorter names (well, and URIs typically 
contain characters illegal in NAME, NCName, NMTOKEN--that's a good 
reason to have not chosen URIs, but it's too late for that).

Prefix bindings (particularly the default prefix, "") may change within 
the scope of a single document (most people won't change the 
non-default prefix, but there are reasons to do it, such as 
concatenating multiple documents together, when you know that there may 
be QNames in content).  By allowing QNames to be part of content, 
information that *ought* to have been restricted to the 
processor/parser is instead exposed to the application.

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
But pain ... seems to me an insufficient reason not to embrace life.  
Being dead is quite painless.  Pain, like time, is going to come on 
regardless.  Question is, what glorious moments can you win from life 
in addition to the pain?
   -- Cordelia Naismith Vorkosigan [Lois McMasters Bujold, "Barrayar"]


[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.