tool to validate xml file against custom XML Schema file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leona

    tool to validate xml file against custom XML Schema file

    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....


  • Patrick TJ McPhee

    #2
    Re: tool to validate xml file against custom XML Schema file

    In article <XLqdnc53ib1uvx 3cRVn-1w@rogers.com>,
    Leona <leonalu@rogers .com> 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
    ptjm@interlog.c om

    Comment

    • rumionfire@gmail.com

      #3
      Re: tool to validate xml file against custom XML Schema file

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

      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.
      [color=blue]
      > 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[/color]

      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 @


      In Peace,
      Saqib Ali

      Comment

      • saqib  ali

        #4
        Re: tool to validate xml file against custom XML Schema file

        > 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


        Comment

        • Jürgen Kahrs

          #5
          Re: tool to validate xml file against custom XML Schema file

          saqib ali wrote:
          [color=blue]
          > 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.[/color]

          xmllint can validate against a DTD.

          Comment

          • Steffen Beyer

            #6
            Re: tool to validate xml file against custom XML Schema file

            On Thu, 28 Oct 2004 09:57:20 +0200
            Jürgen Kahrs <Juergen.KahrsD ELETETHIS@vr-web.de> wrote:
            [color=blue][color=green]
            > > 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.[/color]
            >
            > xmllint can validate against a DTD.[/color]

            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 <sbeyer@reactor .de>

            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

            Comment

            • Johannes Koch

              #7
              Re: tool to validate xml file against custom XML Schema file

              rumionfire@gmai l.com wrote:[color=blue][color=green]
              >>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[/color][/color]
              [...][color=blue]
              > 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[/color]

              But opensp does not support W3C schema.
              --
              Johannes Koch
              In te domine speravi; non confundar in aeternum.
              (Te Deum, 4th cent.)

              Comment

              • Jürgen Kahrs

                #8
                Re: tool to validate xml file against custom XML Schema file

                Steffen Beyer wrote:
                [color=blue]
                > --relaxng schema
                > Use RelaxNG file named schema for validation.
                >
                > --schema schema
                > Use a W3C XML Schema file named schema for validation.
                >
                > are supported, too.[/color]

                Thanks for the hint.
                [color=blue]
                > $ xmllint --version
                > xmllint: using libxml version 20611
                > compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer
                > XInclude Iconv Unicode Regexps Automata Schemas[/color]

                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 !

                Comment

                • rumionfire@gmail.com

                  #9
                  Re: tool to validate xml file against custom XML Schema file

                  [color=blue]
                  > But opensp does not support W3C schema.[/color]

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

                  sorry.

                  Comment

                  • Henry S. Thompson

                    #10
                    Re: tool to validate xml file against custom XML Schema file

                    "Leona" <leonalu@rogers .com> writes:
                    [color=blue]
                    > 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.[/color]

                    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: ht@inf.ed.ac.uk
                    URL: http://www.ltg.ed.ac.uk/~ht/
                    [mail really from me _always_ has this .sig -- mail without it is forged spam]

                    Comment

                    Working...