Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XML Schema validation via JAXP

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XML Schema validation via JAXP
  • Date: Sat, 11 Aug 2007 19:40:25 -0400

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/




Archive powered by MHonArc 2.6.24.

Top of Page