Roll-Your-Own Parsers (was: Re: What Clean Specs Achieve)

hpyle at hpyle at
Wed Feb 10 11:18:43 GMT 1999

Tyler Baker <tyler at> wrote,

> > (roddey at
> > see if that file seems to correspend to the spec and fix their code to
> > handle if so. That is far easier than trying to prove that every method
> > your code meets the spec (though its obviously not the optimum thing to
> > do.)
> Yah, generally if you control how your data is created, you can whip up a
decent parser to
> meet your needs.  Also, if you don't check for a lot of the obscure
errors that may pop up you
> can save yourself a ton of time in processing overhead.  ...
> But if you just want to have some basic XML capabilities for your
> organization and don't want to deal with using other people's codebases,
XML is not too much
> of a beast (understanding the spec takes longer than writing the code at
> > Am I being too cynical here? Maybe so. But, I just don't think that an
> > 'average' developer could write an XML processor that is complete,
> > expandable, maintainable, and speedy, if all he/she had to work with
> > the raw XML spec...
> Very true.  I fell into this trap when people on this list were talking
about how an average
> university CS student could whip one up in a week.  At first I said
"geese this is easy" but
> when I started caring about performance and being able to detect some of
the very obscure
> errors to be 100% compliant with the draft, I found myself going insane
on doing a lot more

Totally agree.  There will always be a tradeoff between code size,
performance and conformance to the spec.  We have taken the same approach:
for XML which might go outside our environment or some in from outside, we
use a heavyweight parser with full validation.  But where it's "behind the
covers" we use a homegrown (tiny, nonconformant) parser and just check the
structures a few times during design, with a validating parser.

> You can thank the many people here who have provided open-source parsers
to work from


hpyle at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list