Lists Home |
Date Index |
> With this type of breakdown it'd be sensible to take *all* the DTD
> processing out of the parser. All a parser would have to do is report
> document type declarations to the application, and make the internal
> subset (if present) available as text. If an application wanted to
> support DTD processing it could add the appropriate layer on top of the
> parser interface (as the equivalent of a SAX filter). The same holds for
> validation. This would have avoided all the problems with different
> levels of validation support using different parsers - just take the
> best parser for your purposes and combine it with the best validator.
You make it sound like this isn't possible using SAX when in fact it is very
possible. But lets suppose you wanted to avoid it anyway and pass the whole
DTD back to the application-- in many cases this would be a huge burden on
memory-- which is one of the reason everyone says they can't include the DTD
parsing logic to begin with.
In GNU JAXP there is a pipeline interface called ValidationConsumer that
handles DTD validation layered cleanly on top of SAX. So you can apply the
best validator to the best parser (assuming you are talking the same
language). Also, I believe RNG has a layered SAX validator. Maybe this
wasn't the point... but it is layered. The fundamental checks for
wellformedness however are not-- but SAX was designed for XML 1.0/1.1 there
should be no surprise that wellformedness is a must for it.