This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes URGENT - Setting feature for SAX Parser in Xerces. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "URGENT - Setting feature for SAX Parser in Xerces." Watch "URGENT - Setting feature for SAX Parser in Xerces." New topic

URGENT - Setting feature for SAX Parser in Xerces.

Lakshmi Ramachandran

Joined: Jun 26, 2001
Posts: 26
Hi Friends,
I am writing an application in Java for parsing an XML document against a schema using Xerces 1.4.1. I am giving a snippet of my code in which I have set some features.
XMLReader parser = (XMLReader)Class.forName(PARSER_NAME).newInstance();
parser.setFeature( "", true);
parser.setFeature( "", true);
parser.setFeature( "", true);
parser.setFeature( "", true);
(1) First of all the following exception is thrown -
at org.apache.xerces.framework.XMLParser.setFeature(
at org.apache.xerces.parsers.SAXParser.setFeature(
at SchemaChecker.main(
(2) When I commented the line
parser.setFeature( "", true);
It says that parsing has been done successfully. But it doesn't as I specifically made mistakes in the XML and the parser could not find that.
Please help me out for parsing XML against Schema using Xerces.
Hope to get an immediate response.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12759
I am looking at Xerces 1.3.1 - source code for
in the org.apache.xerces.framework package. I find the following array of String:
/** Features recognized by this parser. */
private static final String RECOGNIZED_FEATURES[] = {
// SAX2 core
// Xerces
I suggest you look at the source code for your version and see if the "schema-full-checking" type is there.

author of:
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: URGENT - Setting feature for SAX Parser in Xerces.
Similar Threads
XML Schema validation from java using Xercer 1.4.4 and DOM
Pls help: SAXParseException: cvc-complex-type.2.4.c: The matching wildcar
using Schema
XML schema validation problem