JDOM Schema validation & Java 1.5

Discussion in 'Java' started by myexciteac@excite.com, Feb 6, 2006.

  1. Guest

    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?
     
    , Feb 6, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wendy S
    Replies:
    1
    Views:
    6,366
    Darren Davison
    Aug 5, 2003
  2. Bernd Oninger
    Replies:
    4
    Views:
    12,325
    GIMME
    Jun 21, 2004
  3. Tinker
    Replies:
    4
    Views:
    5,323
    Harry Bosch
    Oct 9, 2005
  4. Markus
    Replies:
    1
    Views:
    1,550
    Markus
    Nov 23, 2005
  5. Bernd Oninger
    Replies:
    3
    Views:
    2,881
    GIMME
    Jun 21, 2004
Loading...

Share This Page