[
Lists Home |
Date Index |
Thread Index
]
Greg Alvord wrote:
> Bill de hÓra Wrote:
>
>>And I don't understand this disdain for regular expressions over
>>XML. Regexes are a perfectly useful tool for manipulating text.
>
>
> Certainly "If all you have is a hammer everything looks like a nail."
> applies here. (No distain, I own more than one hammer)
I should have said "I don't understand this disdain for regular
expressions over XML, once you know what you're doing", where "know
what you're doing" implies enough to know that regexes won't cover
the gamut of XML!
> There are two worlds. The world of the "value space" and that of the
> "lexical space". If you use a lexical space tool you run the risk of making
> a new lexical representation for which there is NO value space equivalent.
The worlds I'm thinking about are different again, namely the worlds
of regular and context-free grammars.
> In other words, could you make an error with a regEx tool and end up with
> invalid XML? Yes easily, and probably often.
No argument there.
> If you use tools that manipulate in the "value space", then obtain the
> lexical representation that risk goes away.
That sounds like a job for XPath, among others.
Bill de hÓra
|