Need simple command for validating xml files at the command line

B

Bernd Oninger

Ok, in order to validate a given xml file against a given xsd file I would like to
type at the command prompt something like

java -classpath .;\blah\bluh\foo.jar myxmlfile.xml

Is there such a jar file which helps me to do this?
Unfortunately XercesImpl.jar is not suitable
It yields:

Exception in thread "main" java.lang.NoClassDefFoundError: myxmlfile/xml

Why?

Bernd
 
M

Martin Honnen

Bernd said:
Ok, in order to validate a given xml file against a given xsd file I would like to
type at the command prompt something like

java -classpath .;\blah\bluh\foo.jar myxmlfile.xml

Is there such a jar file which helps me to do this?
Unfortunately XercesImpl.jar is not suitable
It yields:

Exception in thread "main" java.lang.NoClassDefFoundError: myxmlfile/xml

Well the java command needs some Java class to execute and not an XML
file. You would need to write a small Java program using Xerces that you
can then call with the java command.
I can't get through to xml.apache.org currently but I think they
document how to use SAX parsing for instance with validation.
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top