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

Re: XML Redux

  • From: John Cowan <cowan@mercury.ccil.org>
  • To: Stephen Green <stephengreenubl@gmail.com>
  • Date: Tue, 15 Feb 2011 15:52:23 -0500

Re:  XML Redux
Stephen Green scripsit:

> For example the parser might need to have two modes,
> one lax and one strict, to allow on one hand the parsing of the XML as text
> ignoring any encoding 'errors' (like XML5, say) so that at least the parser
> can read in the XML for certain uses (like correction of such 'errors' by
> character escaping/replacing, etc) and on the other hand something which
> focuses on parsing 'valid' XML. 

I'm not attacking *you* here, Stephen, but I do want to attack the
widespread meme that HTML5-style formats and parsers are simpler or easier
to use.  HTML5 is in fact strictly defined: it permits only a single parse
for any given string of characters, and often its parse is *not* easy to
understand unless you have grasped the detailed mental model of HTML5.
Fortunately, there is a smaller and easier-to-understand subset, valid
HTML5, which allows many fewer possibilities, and it's easy to set up
even smaller subsets that are as expressive as full HTML5 but have a
yet simpler model of syntax.

Lax parsers are also more complicated than strict ones.  A strict parser
sees an error, it just gives up.  But a lax parser has to provide
an error recovery strategy that makes sense to the user, which is a
hard problem dating back to the beginning of "automatic programming"
(i.e. writing code in something other than binary notation).

MicroLark, for example, provides a lax parser of MicroXML, but its
recovery strategy is intentionally naive (mostly "revert to character
data") and I would never put it forward as a standard method of error
recovery.  Doing so feels too much like designing a kludge.  If a kludge
becomes commonly used, as HTML5 parsing has, it makes sense to try to
standardize its workings post hoc, but trying to decide in advance what
errors users will make and what their mental model will expect to find
strikes me as a hopeless undertaking.

-- 
So they play that [tune] on                     John Cowan
their fascist banjos, eh?                       cowan@ccil.org
        --Great-Souled Sam                      http://www.ccil.org/~cowan

  • Follow-Ups:
  • References:

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