[Haskell-cafe] Programming style and XML processing in Haskell

Steve Schafer steve at fenestra.com
Fri May 14 11:02:48 EDT 2004


On Thu, 13 May 2004 17:45:25 +0100 (BST), MR K P SCHUPKE
<k.schupke at imperial.ac.uk> wrote:

>I am not sure what application you intend this for, but I find most XML
>parsers completely useless. With my application programmers hat on, I do
>not want to validate against a DTD, I want to extract as much information
>as possible from bad XML... what I would like is a correcting parser - one
>which outputs XML in compliance, but will accept any old rubbish and make
>a best guess attempt to fix it up (based on a set of configurable
>heuristic rules)...

Bear in mind that such a parser would not be in conformance with the XML
specification. The XML Working Group applied the lessons of HTML and
concluded that lax parsing rules lead to far more trouble than they're
worth, and so the XML specification explicitly lists the kinds of
well-formedness errors that might occur in an XML document and that are
_required_ to be flagged by a conforming XML processor as fatal errors.
(And also note that in XML-speak, "valid" and "well-formed" are not the
same thing--an XML parser can be conforming without doing validation,
and an XML document can be well-formed without being valid.)

Obviously, you can do whatever you want in your own code, but I don't
think you should hold your breath waiting for someone else to come up
with that kind of pseudo-XML parser, since by definition it would be a
special-purpose tool.

Steve Schafer
Fenestra Technologies Corp
http://www.fenestra.com/



More information about the Haskell-Cafe mailing list