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

Re: Parsing XML with anything but

  • From: Amelia A Lewis <amyzing@talsever.com>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Mon, 9 Dec 2013 21:39:18 -0500

Re:  Parsing XML with anything but
I should probably avoid this argument. *sigh*

On Mon, 09 Dec 2013 17:08:14 -0500, Simon St.Laurent wrote:
> Yes, it's true that writing applications that apply regular 
> expressions or other text processing to "complete" XML can be 
> dangerous.  That doesn't mean that people doing that are stupid or 
> poorly trained, however, and neither does it mean that they haven't 
> tried their local XML toolsets first and found them wanting.

Simon, I'm afraid that I have to differ with you. Anyone who uses 
regular expressions for a grammar that relies extensively on parity is 
either stupid or poorly trained. Sure, you can do text processing (== 
processing of element names, attribute names, attribute values, and 
text node contents (without distinguishing reliably between them)) 
using regular expressions. You can't reliably establish XML structure, 
because the syntax of XML is specified by a grammar that cannot be 
handled by a finite automaton, that is not a regular grammar.

Using regular expressions to handle XML (except in specialized 
circumstances, possibly including "s/Soviet Union/Russian 
Federation/g", but almost certainly not including "s/soviet/russian/gi" 
because the latter (apart from demonstrating a lamentable historical 
illiteracy (speaking as a formally-trained historian of the Soviet 
Union, once upon a time)) is too apt to change attribute or element 
names) is, to follow the pattern of analogy common in recent threads, 
about the equivalent of handing a carpenter framing lumber and screws 
and watching him whip out his ... hammer. A carpenter who does so 
(except in specialized circumstances) is aptly regarded as stupid or 
poorly trained (generically: not competent to handle the problem). More 
to the point, the structure such a carpenter creates is going to 
*fail*, which means it is appropriate for other carpenters to say "that 
ain't right."

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
Yankees are compelled by some mysterious force to imitate Southern 
accents and they're so damn dumb they don't know the difference beween
a Tennessee drawl and a Charleston clip.
                -- Rita Mae Brown, "Rubyfruit Jungle"


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