File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 13037
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:
I agree. Here's the link:
subject: URGENT - Setting feature for SAX Parser in Xerces.
It's not a secret anymore!