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

The XML abstraction leaks

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Thu, 11 Aug 2016 10:34:18 +0000

The XML abstraction leaks

Hi Folks,

XML is an abstraction. The abstraction is this: an XML document contains data and the data is surrounded (delimited) by markers. More concretely, an XML document contains pairs of start-tags and end-tags, sandwiched between them is character data and possibly other start-tag, end-tag pairs.

The XML abstraction is leaky. The five reserved characters (less-than, greater-than, apostrophe, quote, ampersand) are leaks in the abstraction. What does it mean for the XML abstraction to leak? It means that you, the user of the XML abstraction, must understand to some extent how software that implements the XML abstraction—the XML processor—works internally. In particular, you must understand that, unlike all the other 100,000+ Unicode characters that you can put in your XML document, an XML processor treats five characters differently and if you want to use one of these characters in your data then you must perform magic voodoo (you must escape the characters) to get the XML processor to forget the fact that you are using a reserved character. In other words, you have to understand how the XML processor lexically tokenizes your XML document. That’s a leak in the abstraction.

Leaks are bad.

It’s best to create abstractions that don’t leak.

Does the XML abstraction leak in other ways?

Does the JSON abstraction leak?

Does the Unicode abstraction leak?

This issue of leaky abstractions is of great interest to me. If you have examples of other abstractions that leak, would you mind sharing them please?

For more info on leaky abstractions, see Joel Spolsky’s article, The Law of Leaky Abstractions (http://www.joelonsoftware.com/articles/LeakyAbstractions.html)

/Roger



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