469,366 Members | 2,428 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

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....
Jul 20 '05 #1
9 12255
In article <XL********************@rogers.com>,
Leona <le*****@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
pt**@interlog.com
Jul 20 '05 #2
> 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
Jul 20 '05 #3
> 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

Jul 20 '05 #4
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.
Jul 20 '05 #5
On Thu, 28 Oct 2004 09:57:20 +0200
Jürgen Kahrs <Ju*********************@vr-web.de> 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 <sb****@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
Jul 20 '05 #6
ru********@gmail.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
[...] 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.)
Jul 20 '05 #7
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 !
Jul 20 '05 #8
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.

Jul 20 '05 #9
"Leona" <le*****@rogers.com> 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: 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]
Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Aaron P Frenger | last post: by
1 post views Thread by QuantDev | last post: by
6 posts views Thread by Jonny | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.