File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validate XML against XSD using the Xerces DOM Parser

 
beda meda
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20164
24
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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'.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic