jQuery in Action, 3rd edition
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Validating an XML fragment against a schema.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Validating an XML fragment against a schema.." Watch "Validating an XML fragment against a schema.." New topic

Validating an XML fragment against a schema..

Ronan Dowd
Ranch Hand

Joined: Jan 21, 2006
Posts: 84
Hi All,

Just wondering if there's a handy tool out there (on the web etc) that enables an XML fragment to be validated against a schema ?
I do realised I could write a SAX/DOM java class which would validate it one against the other but was wondering if there's a tool on
the web (maybe soapUI or something like it) that currently exists ?

Any help would be great.
Thanks, Ro

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 547


XMLSpy is one of the tools which you can use. But I vaguely remember about an eclipse plugin which is freely available that can be used for this purpose. Recenly I used Oxygen XML for an evaluation period of 30 days and it is pretty cool.


Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
While XMLSpy and Oxygen are excellent tools, all you need in this situation is Eclipse.
Make sure that you have specified the schema location in your XML document, then right-click on the XML document or in the editor of the XML document and select Validate.
It will validate your XML document against the XML schema.
Experiment with some illegal data in the XML document to see that validation fails.
Best wishes!

My free books and tutorials: http://www.slideshare.net/krizsan
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183

There are web tools, such as XML Schema Validator or the official W3C Validator for XML Schema.


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I agree. Here's the link: http://aspose.com/file-tools
subject: Validating an XML fragment against a schema..
jQuery in Action, 3rd edition