aspose file tools*
The moose likes XML and Related Technologies and the fly likes Validate XML against XSD using the Xerces DOM Parser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Validate XML against XSD using the Xerces DOM Parser" Watch "Validate XML against XSD using the Xerces DOM Parser" New topic
Author

Validate XML against XSD using the Xerces DOM Parser

beda meda
Greenhorn

Joined: Jul 15, 2010
Posts: 6
Hi!
I need to read XML with the Xerces DOM Parser and also validate it against prepared XSD. So far, I have this:





Now I tried to find how to do the validation, but without success. I believe it should be done by setting



but I don't now, what should be in the argument. Or am I wrong and there is different way? Thanks!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18986
    
    8

Well, first of all, don't import that "com.sun" package. Use the standard XML parsers instead. And you should find your answer in this page from the Ranch's XML FAQ: HowToValidateXmlAgainstSchema
beda meda
Greenhorn

Joined: Jul 15, 2010
Posts: 6
Paul Clapham wrote:Well, first of all, don't import that "com.sun" package. Use the standard XML parsers instead. And you should find your answer in this page from the Ranch's XML FAQ: HowToValidateXmlAgainstSchema

But if I remove 'com.sun' and leave only it says, there is no such class in package 'org.apache.xerces.parsers'.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validate XML against XSD using the Xerces DOM Parser