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

Re: XML's Scylla and Charybdis - parse and regexp


c regexp
From: "Jonathan Robie" <jonathan.robie@d...>


> At 08:35 AM 4/1/2003 -0800, Dare Obasanjo wrote:
> 
> >In my experience faithful lexical round tripping is mainly important to 
> >applications that act as editors. In such cases, the people requesting 
> >such features in an API want even more requirements than XML 1.0 deems 
> >necessary such as preserving attribute order and all whitespace.
> 
> Yes, it's clearly helpful for that. I also know from XML databases I've 
> worked with that people really do get upset if you change namespace 
> prefixes when they import a document and export it again - but most editors 
> and databases do seem to sacrifice some faithfulness in their lexical 
> round-tripping.

One important application of XML is as source code.  

Imagine if a programming editor opened your Perl/Python/C#/Java/C++/SQL
program, renamed names of modules or classes or private methods or packages,
and threw away comments. You would undoubtedly spew, despite your
admirably easy-going nature. 

Someone wrote:

> >If the Information Set says that there is no distinction between <foo
> >"a"/> and <foo 'a'/>, why should I work hard to preserve the
> >distinction?

Because syntactic sugar is vital for humans, and can help processing.

This here thread comes out of a complaint about XML being too complex
to use regexes. Yet if we canonicalize our data (say, including that only <foo
x="a" /> is used ) then the regular expressions simplify themselves to something
much more useable.  If other software messes up this canonical form,
then we have to re-canonicalize it.  (Which suggests not that we should
work hard to preserve the distinction, but that if it is convenient we should 
support it.)

Cheers
Rick Jelliffe



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.