File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

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


SCJP 1.4 | OCWCD JEE 5
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 522
    
    2

Hi,

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.


Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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: 1180
Ronan,

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

Regards,
Dan


William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
 
Don't get me started about those stupid light bulbs.
 
subject: Validating an XML fragment against a schema..