Hi All,
I am trying to build a customized online validator, and I need the "http://apache.org/xml/properties/external-SchemaLocation
" property for explicitly defining a schema to validate against, even
if no schema is provided in the document.
The problem is that I always get a : SAXNotRecognizedException :
"Property 'http://apache.org/xml/properties/external-SchemaLocation'
is not recognized.".
I am using Xerces-j 2.9.1 . I have tried it by setting this property
to the xmlreader and the saxparser itself, but nothing works... Could
you please tell me what I am doing wrong ?
Here is my code :
System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema
","org.apache.xerces.jaxp.validation.XMLSchemaFactory");
System
.setProperty
("org
.apache
.xerces
.xni
.parser
.XMLParserConfiguration
","org.apache.xerces.parsers.IntegratedParserConfiguration");
String language = XMLConstants.W3C_XML_SCHEMA_NS_URI;
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(true);
spf.setNamespaceAware(true);
spf.setFeature("http://apache.org/xml/features/validation/schema",
true);
parser = spf.newSAXParser();
XMLReader xmlReader = parser.getXMLReader();
xmlReader.setProperty("http://apache.org/xml/properties/external-SchemaLocation
","http://ltsc.ieee.org/xsd/LOM http://ltsc.ieee.org/xsd/lomv1.0/lomLoose.xsd
");
Thanks a lot in advance for you help !
greetings,
Bram Vandeputte
--
Bram Vandeputte
Katholieke Universiteit Leuven
Dept. Computer Science
Celestijnenlaan 200A, A03.010
B-3001 Leuven, Belgium
Phone: +32 16 327659
Mob: +32 474 667796
Fax: -