Question about Xerces ????

B

Bekkali Hicham

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
 
P

Peter C. Chapin

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
 
J

Jean-Marc Vanel

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.
 

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

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top