Need simple command for validating xml files at the command line

Discussion in 'XML' started by Bernd Oninger, Jul 7, 2004.

  1. 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
     
    Bernd Oninger, Jul 7, 2004
    #1
    1. Advertising

  2. Bernd Oninger wrote:

    > 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.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jul 7, 2004
    #2
    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. Ben Jessel
    Replies:
    0
    Views:
    434
    Ben Jessel
    Aug 5, 2004
  2. Hatem KNANI
    Replies:
    2
    Views:
    676
    Morphon Technologies
    Aug 4, 2003
  3. Clifford W. Racz

    Checking XML DTD syntax and validating XML

    Clifford W. Racz, Jun 7, 2004, in forum: XML
    Replies:
    8
    Views:
    1,702
    Clifford W. Racz
    Jun 23, 2004
  4. First_step_to_xml
    Replies:
    0
    Views:
    721
    First_step_to_xml
    Jun 28, 2006
  5. Erik Wasser
    Replies:
    5
    Views:
    494
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page