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

XML Validation

 
Jeff Storey
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi - I'm trying to validate an XML document against an XSD document. I'm currently using Xerces-J. I've found that I can turn on validation by setting a validation feature and then setting a property pointing to my XSD document. But, when I run the parser, I get errors about my DOCROOT being incorrect because it doesn't point to a DTD file (I actually don't have a DOCROOT tag at all in my XML doc). I'm trying to validate against an XSD, NOT a DTD. Is there a way to do this?

Thanks,
Jeff
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's one of many XML questions answered by the XML FAQ.
 
Jeff Storey
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for that link. I appreciate the help.
 
Jeff Storey
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it just the example that validates using XSD or is there a specific section showing how to turn off DTD validation?

Thanks,
Jeff
 
sachin poddar
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeff,
try this-
http://xerces.apache.org/xerces2-j/faq-pcfp.html
see section-
"How can I tell the parser to validate against XML Schema and not to report DTD validation errors?"
 
Jeff Storey
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the slow response -- but thanks for the help. That was quite useful.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic