Question about Xerces ????

Discussion in 'XML' started by Bekkali Hicham, Jun 27, 2003.

  1. 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
    Bekkali Hicham, Jun 27, 2003
    #1
    1. Advertising

  2. In article <bdhf6d$9u$>,
    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
    Peter C. Chapin, Jun 27, 2003
    #2
    1. Advertising

  3. 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 ?
    Jean-Marc Vanel, Jul 5, 2003
    #3
    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. Bassa
    Replies:
    0
    Views:
    968
    Bassa
    Sep 19, 2003
  2. Naren
    Replies:
    1
    Views:
    608
    Martin Honnen
    Nov 21, 2003
  3. David
    Replies:
    4
    Views:
    3,781
    Toni Uusitalo
    Dec 17, 2003
  4. mel-tey chamon!
    Replies:
    2
    Views:
    1,352
    Patrick TJ McPhee
    May 16, 2004
  5. cvissy
    Replies:
    0
    Views:
    592
    cvissy
    Nov 16, 2004
Loading...

Share This Page