| Author |
feature not recognized for SAX driver parser.XMLReaderI
|
john mattucci
Ranch Hand
Joined: Nov 03, 2000
Posts: 331
|
|
I run the following in Eclipse and everything is fine however when I run it somewhere else I get the error which follows the code. Is it possible that im using old jars? import java.io.*; import java.util.*; import org.jdom.*; import java.util.regex.*; import org.jdom.xpath.*; import org.jdom.input.*; public class Test2 { public static void main(String []args) { Test2 s = new Test2(); try { s.test(); } catch(Exception e) { e.printStackTrace(); } } public void test() throws Exception { try { Document doc = null; SAXBuilder saxBuilder =new SAXBuilder(); saxBuilder.setFeature("http://xml.org/sax/features/validation", true); saxBuilder.setFeature("http://apache.org/xml/features/validation/schema", true); saxBuilder.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true); saxBuilder.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation","test.xsd"); doc = saxBuilder.build("test.xml"); 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:731) at.org.jdom.input.SAXBuilder.setFeaturesAndProperties(SaxBuilder.java:670) at.org.jdom.input.SAXBuilder..createParser(SAXBuilder.java:552) at.org.jdom.input.SAXBuilder..build(SAXBuilder.java:426) at.org.jdom.input.SAXBuilder..build(SAXBuilder.java:426) .......
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12265
|
|
Since the error mentions: org.apache.crimson.parser.XMLReaderImpl I think you need the crimson parser package, not the standard Java one. According to http://xml.apache.org/ the crimson parser project is inactive. Which version of Java SDK do you have? Bill
|
Java Resources at www.wbrogden.com
|
 |
john mattucci
Ranch Hand
Joined: Nov 03, 2000
Posts: 331
|
|
|
the crimson.jar is included
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
That is a Xerces feature, not Crimson. In other words, you need to download Xerces.
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
john mattucci
Ranch Hand
Joined: Nov 03, 2000
Posts: 331
|
|
|
thank you so much lasse that was the issue
|
 |
 |
|
|
subject: feature not recognized for SAX driver parser.XMLReaderI
|
|
|