[XOM-interest] XML Schema validation via JAXP
Peter Stibrany
pstibrany at gmail.com
Sun Aug 12 14:18:54 EDT 2007
Hello,
Re 2: Installing custom error handler helped me to solve my problem on
JDK 1.6. Thank you!
Re 1: why is XMLReaderFactory preferred over SAXParserFactory
approach? If I would use XMLReaderFactory, I would need to rely on
implementation-specific features to use schema validation.
Thank you for your suggestions,
-Peter
On 8/12/07, Elliotte Harold <elharo at metalab.unc.edu> wrote:
> Peter Stibrany wrote:
>
> > This works for me in Java 1.5, where it throws ParsingException when
> > document isn't valid. Unfortunately, on Java 6 it returns parsed
> > document even if it is invalid with respect to schema.
> >
>
> 1. I suggest using XMLReaderFactory instead of SAXParserFactory, though
> that likely won't fix the problem.
>
> 2. You probably need to install your own SAX ErrorHandler that throws an
> exception if the document is invalid.
>
> --
> Elliotte Rusty Harold elharo at metalab.unc.edu
> Java I/O 2nd Edition Just Published!
> http://www.cafeaulait.org/books/javaio2/
> http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/
> _______________________________________________
> XOM-interest mailing list
> XOM-interest at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
>
More information about the XOM-interest
mailing list