How to validate an XML,given its XSD in jdk 1.4.2_09

Hi all,

Given : XML, XSD Files

Environment : j2sdk1.4.2_09

Task : Validate the XML with the given XSD and throw error if validation fails.

so kindly help me out in it. a sample code will be very much helpful.

i worked on this using org.xml.validation.Validator class and successfully obtained the result in jdk1.5. But i dont know how to do in jdk1.4.2_09. please do help me out.

i have to do in jdk1.4.2_09 coz it is the requirement. so no scope of upgrading the jdk/jre.

Thanks in advance.

Regards,

Sundararamaprasad

[579 byte] By [SundaraRamaPrasada] at [2007-10-2 20:32:00]
# 1

Does this help?

http://www.onjava.com/pub/a/onjava/2004/09/15/schema-validation.html

Also can't remember whether the default parser with java 1.4 was xerces or crimson. Crimson can't validate schemas, so in this case you would need to set the a system property to force the JVM to use xerces.

Sorry I haven't been more specific. - I've been using 1.5 for the last year and am getting "wooly" over what came with 1.4 and what you had to bolt on / configure.

SteveNaivea at 2007-7-13 23:15:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

HI,

Thanks for the suggestion.... The Thing is when i compiled and executre my code it really got execute well when i ran it in the Command Prompt after settiongup appropriate classpath and path... but when i executed the same thing in the server it did not get executed though the application server also run on top of the same JDk.....I've check it out..anyhow the link gave me a very good learning...Thanks for the valuable suggestion..... :)

Regards,

Sundararamaprasad.

SundaraRamaPrasada at 2007-7-13 23:15:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Then it's probably a classpath issue. Your app server may already an XML libraries in the server lib which you're picking up.
SteveNaivea at 2007-7-13 23:15:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...