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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top