File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XML Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Validation" Watch "XML Validation" New topic
Author

XML Validation

Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
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
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
That's one of many XML questions answered by the XML FAQ.


Ping & DNS - updated with new look and Ping home screen widget
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Thanks for that link. I appreciate the help.
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
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

Joined: Feb 10, 2006
Posts: 17
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?"


Sachin. [SCJP 1.4, SCWCD 5]
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
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
 
subject: XML Validation
 
Similar Threads
XML Validation
XML Validation
DTD Validation Using an Editor
Validation - best approach
XML Schema Help