Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validating XML with Schema

 
Gus Mus
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the URLs you are referencing in the setFeature calls?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic