[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xml-dev] When to Validate XML Guidelines
- From: "Simon St.Laurent" <email@example.com>
- To: firstname.lastname@example.org
- Date: Mon, 01 Oct 2001 14:32:09 -0400
On Mon, 2001-10-01 at 10:18, Magick, Brian wrote:
> In this example and in others I have heard many compelling arguments
> from each side, but nothing definitive. Any thoughts or best practices
> in general regarding when to validate XML?
I, uh, pretty much never validate. except for occasional testing.
The parts of DTDs which I use tend to be the attribute defaulting bits,
and that mostly for XLink, which I haven't used much lately. Those work
well with most of the Java parsers I use, but they frequently disappear
with expat implementations, so I'm trying to break myself of the habit.
Validation is kind of useful for making sure that certain kinds of
failures won't strike your application, but generally I try to write
code that does the best it can and doesn't panic if there's extra
content or non-critical missing content.
Validation can be handy as a cheap tool you can hand document authors to
make sure they've concocted something processable. The nature of
"processable" varies a lot, though, and I'm pondering switching most of
the work I do in that field from DTDs to Schematron and/or RELAX NG.
Schematron's customizable reporting is fantastic, and RELAX NG fits the
kinds of structures I tend to deal with quite neatly.
I still recommend that people write DTDs or their favorite flavors of
schema when they create a new vocabulary, even if they don't plan to
validate. I find it can clarify thought processes and it's useful
documentation. Of course, I probably need to go back and make sure I've
updated all those DTDs...
"Every day, in every way, I'm getting better and better." - Emile Coue