tool to validate xml file against custom XML Schema file

Discussion in 'XML' started by Leona, Oct 27, 2004.

  1. Leona

    Leona Guest

    Hello all,

    does anyone know of a tool, preferably free, preferably on linux, which will
    take an xml file and validate it against your own custom W3C XML Schema file
    (.xsd) ??

    All help appreciated - it's proving very difficult to find.
    Failing that, does anyone know how to get the W3C's own online validating
    engine (XSV, I think it's called) to do the same job? I can't get it to do
    what I want and I can't really understand the output.

    Many thanks in advance....
    Leona, Oct 27, 2004
    #1
    1. Advertising

  2. In article <>,
    Leona <> wrote:

    % does anyone know of a tool, preferably free, preferably on linux, which will
    % take an xml file and validate it against your own custom W3C XML Schema file
    % (.xsd) ??

    How about xmllint from libxml?

    % All help appreciated - it's proving very difficult to find.

    Depending on what you have on your system, look in /usr/local/bin. Failing
    that, try http://xmlsoft.org

    --

    Patrick TJ McPhee
    East York Canada
    Patrick TJ McPhee, Oct 28, 2004
    #2
    1. Advertising

  3. Leona

    Guest

    > does anyone know of a tool, preferably free, preferably on linux, which will
    > take an xml file and validate it against your own custom W3C XML Schema file


    You can use openjade from cmd line to do this. openjade
    (http://openjade.sf.net) comes with most major linux distros. type in
    onsgmls on the cmd line to get more info.

    > Failing that, does anyone know how to get the W3C's own online validating
    > engine (XSV, I think it's called) to do the same job? I can't get it to do


    W3C's online validator is merely a web interface to openjade. It
    passed the input file to openjade, and takes the output and displays
    it as a webpage. i use the same technique for the docbook validator @
    http://validate.sf.net

    In Peace,
    Saqib Ali
    http://validate.sf.net
    , Oct 28, 2004
    #3
  4. Leona

    saqib ali Guest

    > How about xmllint from libxml?

    as far as i know, xmllint only checks if the document is well-formed or
    not. It does NOT check for the validity of the document against a
    schema. Please correct if I am wrong.
    Thanks.
    Saqib Ali
    http://validate.sf.net
    saqib ali, Oct 28, 2004
    #4
  5. saqib ali wrote:

    > as far as i know, xmllint only checks if the document is well-formed or
    > not. It does NOT check for the validity of the document against a
    > schema. Please correct if I am wrong.


    xmllint can validate against a DTD.
    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=, Oct 28, 2004
    #5
  6. On Thu, 28 Oct 2004 09:57:20 +0200
    J├╝rgen Kahrs <> wrote:

    > > as far as i know, xmllint only checks if the document is well-formed
    > > or not. It does NOT check for the validity of the document against a
    > > schema. Please correct if I am wrong.

    >
    > xmllint can validate against a DTD.


    That's right, but

    --relaxng schema
    Use RelaxNG file named schema for validation.

    --schema schema
    Use a W3C XML Schema file named schema for validation.

    are supported, too.

    $ xmllint --version
    xmllint: using libxml version 20611
    compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer
    XInclude Iconv Unicode Regexps Automata Schemas

    Regards,
    --
    Steffen Beyer <>

    GnuPG key fingerprint: CA00 1611 242B 89D4 E643 E235 05F3 7689 DD3E EB26
    Public key available upon request or at http://wwwkeys.de.pgp.net
    Steffen Beyer, Oct 28, 2004
    #6
  7. wrote:
    >>does anyone know of a tool, preferably free, preferably on linux, which will
    >>take an xml file and validate it against your own custom W3C XML Schema file

    [...]
    > W3C's online validator is merely a web interface to openjade. It
    > passed the input file to openjade, and takes the output and displays
    > it as a webpage. i use the same technique for the docbook validator @
    > http://validate.sf.net


    But opensp does not support W3C schema.
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
    Johannes Koch, Oct 28, 2004
    #7
  8. Steffen Beyer wrote:

    > --relaxng schema
    > Use RelaxNG file named schema for validation.
    >
    > --schema schema
    > Use a W3C XML Schema file named schema for validation.
    >
    > are supported, too.


    Thanks for the hint.

    > $ xmllint --version
    > xmllint: using libxml version 20611
    > compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer
    > XInclude Iconv Unicode Regexps Automata Schemas


    Most of my daily work is on RedHat 7.2 and there
    we have an xmllint which can only validate against
    a DTD. But the xmllint that comes with RedHat 9.0
    behaves as describes by you. I will use it !
    =?ISO-8859-15?Q?J=FCrgen_Kahrs?=, Oct 28, 2004
    #8
  9. Leona

    Guest


    > But opensp does not support W3C schema.


    that is correct. sorry. i should have read the original post more
    carefully. it must have been very late in the night :)

    sorry.
    , Oct 28, 2004
    #9
  10. "Leona" <> writes:

    > Failing that, does anyone know how to get the W3C's own online validating
    > engine (XSV, I think it's called) to do the same job? I can't get it to do
    > what I want and I can't really understand the output.


    Two alternative answers:

    1) If your W3C XML Schema document is available on the web, you can
    give the XSV web form both the instance URI and the schema
    document URI and it will validate for you

    2) If not, you can download and install an rpm and run it from the
    command line

    Detailed instructions for both approaches are at [1].

    ht

    [1] http://www.ltg.ed.ac.uk/~ht/xsv-status.html
    --
    Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 650-4587, e-mail:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
    Henry S. Thompson, Nov 1, 2004
    #10
    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. Replies:
    2
    Views:
    567
  2. Paco
    Replies:
    4
    Views:
    3,546
  3. ric_deez
    Replies:
    0
    Views:
    1,049
    ric_deez
    Apr 3, 2006
  4. Stefan
    Replies:
    3
    Views:
    1,959
    Martin Honnen
    Mar 29, 2008
  5. Shawn

    validate xml against schema

    Shawn, Jan 27, 2004, in forum: ASP General
    Replies:
    1
    Views:
    139
    Chris Hohmann
    Jan 27, 2004
Loading...

Share This Page