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

Re: Re: If XML is too hard for a programmer, perhaps he'd be b

  • To: xml-dev@l...
  • Subject: Re: Re: If XML is too hard for a programmer, perhaps he'd be better off as a crossing guard
  • From: Sean McGrath <sean.mcgrath@p...>
  • Date: Fri, 28 Mar 2003 08:48:18 +0000
  • Cc: bill de hÓra <bill@d...>

xml supplier
[Bill de hÓra]
 >And I don't understand this disdain for regular expressions over XML.
 >Regexes are a perfectly useful tool for manipulating text.

Hi Bill,

I used regexp's myself - I'd say about 30% of the time when processing XML. 
It makes me nervous
though and I try not to do it in any mission critical context.

The trouble comes in having a degree of confidence in the correctness of 
the regexps.

For example, on the face of it using a regexp to catch occurences of:
         <name>Sean</name>
is simple. Not so for a many reasons. Writing regexps capable of getting 
this right
in the full generality of XML 1.0 is tantamount to writing a full xml 1.0 
WF parser.

The standard answer I get when I harp on about this is something
like "ah, but I know the XML I'm processing is machine generated and consistent
therefore...".

I always feel uneasy relying on the upstream XML supplier like this! It 
introduces a
degree of brittle coupling in systems that is best avoided if possible.

I can only see two routes to making XML regexping as safe as it is convenient:

1) Make a profile of XML 1.0 *syntax* that is regexp safe (permathread anyone?)

2) Use a post-parse syntax for regexp work like PYX notation

regards,
Sean


http://seanmcgrath.blogspot.com



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.