469,296 Members | 2,147 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,296 developers. It's quick & easy.

Question about Xerces ????

hi, i have downloaded the latest version 2.4 of Xerces, and unziped it, i
end up with a diectory hierarchy like this
c:\xerces-2_4_0\XercesImpl.jar
c:\xerces-2_4_0\XercesSamples.jar
c:\xerces-2_4_0\xml-apis.jar
c:\xerces-2_4_0\xmlParserAPIS.jar
c:\xerces-2_4_0\data
c:\xerces-2_4_0\docs
c:\xerces-2_4_0\samples
there is no bin directory, my question is :
i want to check the validity of an xml file say 'myfiche.xml' with its
appropriate dtd file say 'mydtd.dtd'
wihch class have i to use to do that at the dos command line ? is there
another way to do this outside the dos prompt ?

THANKS for your help
Jul 20 '05 #1
2 2524
In article <bd*********@news-reader4.wanadoo.fr>,
hi************@wanadoo.fr says...
hi, i have downloaded the latest version 2.4 of Xerces, and unziped it, i
end up with a diectory hierarchy like this
c:\xerces-2_4_0\XercesImpl.jar
c:\xerces-2_4_0\XercesSamples.jar
c:\xerces-2_4_0\xml-apis.jar
c:\xerces-2_4_0\xmlParserAPIS.jar
c:\xerces-2_4_0\data
c:\xerces-2_4_0\docs
c:\xerces-2_4_0\samples
there is no bin directory, my question is :
i want to check the validity of an xml file say 'myfiche.xml' with its
appropriate dtd file say 'mydtd.dtd'
wihch class have i to use to do that at the dos command line ? is there
another way to do this outside the dos prompt ?


I use the following batch file to validate documents with Xerces

---- cut ----
@echo off

set CLASSPATH=d:\misc\xerces-2_3_0\xmlParserAPIs.jar
set CLASSPATH=%CLASSPATH%;d:\misc\xerces-2_3_0\xercesImpl.jar
set CLASSPATH=%CLASSPATH%;d:\misc\xerces-2_3_0\xercesSamples.jar

java sax.Counter -n -np -v -s -f %1
---- cut ----

The "-v" option turns on validation. The sax.Counter program is a sample
program that just prints out a count of the elements in a document.
However, with "-v" it also prints out error messages if the document is
invalid.

Hope this helps.

Peter
Jul 20 '05 #2
I do essentially the same as P.C. Chapin but I have added to sax.Counter some
code to check validity with respect to a given XML Schema (which not necessarily
the one indicated in the XML instance); see code here:
http://jmvanel.free.fr/xsd/Counter.java
http://jmvanel.free.fr/xsd/valid-sitemap.txt

However the future standard way to do that is with DOM 3 API's. But these are
not currently build by default in Xerces, although the code is here. I
investigete this currently.

Bekkali Hicham wrote:
hi, i have downloaded the latest version 2.4 of Xerces, and unziped it, i
end up with a diectory hierarchy like this .... there is no bin directory, my question is :
i want to check the validity of an xml file say 'myfiche.xml' with its
appropriate dtd file say 'mydtd.dtd'
wihch class have i to use to do that at the dos command line ? is there
another way to do this outside the dos prompt ?


Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Waseem | last post: by
reply views Thread by Dale Gerdemann | last post: by
2 posts views Thread by kzawah | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.