This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Product and Other Certifications and the fly likes Validating XML with Schema Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Validating XML with Schema" Watch "Validating XML with Schema" New topic
Author

Validating XML with Schema

Gus Mus
Ranch Hand

Joined: Feb 28, 2003
Posts: 53
I have codes below,
I just want the builder to check the Schema :
StringReader reader = new StringReader(xml);
SAXBuilder builder = new SAXBuilder(true);
builder.setFeature( "http://apache.org/xml/features/validation/schema", true );
builder.setFeature( "http://xml.org/sax/features/validation", true );
Document document = builder.build(reader);
But it always return error :
com.wirecard.tools.xml.XMLException: Fail to convert XML to JDOM : http://apache.org/xml/features/validation/schema feature not recognized for SAX driver org.apache.crimson.parser.XMLReaderImpl;
---> nested org.jdom.JDOMException: http://apache.org/xml/features/validation/schema feature not recognized for SAX driver org.apache.crimson.parser.XMLReaderImpl
org.jdom.JDOMException: http://apache.org/xml/features/validation/schema feature not recognized for SAX driver org.apache.crimson.parser.XMLReaderImpl
at org.jdom.input.SAXBuilder.internalSetFeature(SAXBuilder.java:646)
Any Idea ?
John Wetherbie
Rancher

Joined: Apr 05, 2000
Posts: 1449
What are the URLs you are referencing in the setFeature calls?


The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validating XML with Schema