JDOM Schema validation & Java 1.5

M

myexciteac

I'm attempting to validate an XML document against a Schema using
Xerces. Using JDOM (1.0) under Java 1.4 this was accomplished as
follows:

myBuilder = new
SAXBuilder("org.apache.xerces.parsers.SAXParser",true);

myBuilder.setFeature("http://apache.org/xml/features/validation/schema",true);
myParsedXmlDoc = myBuilder.build(xmlFile);

Since Java 1.4 uses Crimson as the default XML parser, I had to
reference the Xerces JAR files in the classpath. Our requirements now
require us to use Java 1.5 as the JVM - no problem, Java 1.5 includes
Xerces as the default XML parser. Unfortunately, I am getting a
"org.jdom.input.JDOMParseException" error when attempting to
validate using Java 1.5. I'm intentionally not including Xerces JAR
files in the classpath since 1.5 already includes Xerces. What am I
doing wrong? Can someone show me how to do this using JDOM and Java
1.5?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top