Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Need simple command for validating xml files at the command line

Reply
Thread Tools

Need simple command for validating xml files at the command line

 
 
Bernd Oninger
Guest
Posts: n/a
 
      07-07-2004
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      07-07-2004


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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Validating parsed XML document against XML-schema TKok Java 1 12-08-2005 02:01 PM
Validating XML against a DTD that is not supplied in the XML Schema Ben Jessel Java 0 08-05-2004 11:45 AM
Checking XML DTD syntax and validating XML Clifford W. Racz XML 8 06-23-2004 08:12 PM
XML Editor WYSIWYG Word processor-like validating XML Editor ?! Hatem KNANI XML 2 08-04-2003 03:22 PM



Advertisments