Hi Wulf,

Wulf Berschin <bersc...@dosco.de> wrote on 02/04/2010 10:48:19 AM:

> Hi Michael,
>
> xes, we want to parse with validation switched on. Not only for
> retrieving XML errors but for getting attribute default values as well.
> And our documents are based on old-fashioned DTDs... Did not unsderstand
> if the mentioned Validation API supports validation against DTDs too.

There's no technical reason it can't, however Xerces only provides an
implementation of the Validation API for XML Schema.

If you would like to use this capability I'd suggest converting your DTDs
to XSDs. You can do it on the fly with the NekoDTD converter [1] and the
stylesheets [2] provided with it.

> In our project we use JAXP transformer and pipe different
> transformations together. It would be nice to have a Validator as
> TransformerHandler there since sometimes instances need a "cleaning"
> before they can be parsed....

You should be able to hook a ValidatorHandler [3] into your pipeline.

> Thank you for your help.
>
> Wulf

Thanks.

[1] http://people.apache.org/~andyc/neko/doc/dtd/index.html
[2] http://people.apache.org/~andyc/neko/doc/dtd/conversions.html
[3]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/ValidatorHandler.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to