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)
.......