Hello Xercianer,

I have to validate a XML file against a XSD and tried the java version 
of xerces for this task.
I simply installed Xerces (2.8) and the sample-jar  and called

java sax.Writer -v -f -s foo.xml 1>/dev/null | grep Error

I'm not interested in the output. Because I'm on Unix I redirect
the output to /dev/null and I grep  stderr for "Error" to detect
all kind of errors. If the return code of grep is 0 then the XML file
is not valid.

My questions: 
1. Is there a better java-xerces "tool" for doing that task
    (something like xmllint in java) ?
    (I missed the possibility to suppress the output via a command line
     switch.)
2. Is it reliable to grep for Error in stderr ? Are there situations there no
    Error-line is printed but the XML is still corrupt ?
    (The C++ version of Xerces comes with samples too and when I call
     SAX2Print ... I'm able to detect validation/parse errors via the return 
code
     of the program. This seems not the case with the java version.)

Best regards,
Thomas



-- 
http://www.randspringer.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to