I have posted this question on StackOverflow here:

http://stackoverflow.com/questions/12072867/xerces-feature-not-recognized-for-schemafactory-but-ok-for-validator

I am trying to set features for Xerces XML validation. I am having a hard
time finding / understanding which features are valid for the
`SchemaFactory` and for the `Validator`.

I have the following code:

    SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_US_URI);
    factory.setFeature("http://xml.org/sax/features/validation";, true);

    Schema schema = factory.newSchema(mySchemaList);
    Validator validator = schema.newValidator;
    validator.setFeature("http://xml.org/sax/features/validation";, true);

If I do the above I get:
`SAXNotRecognizedException: Feature 'http://xml.org/sax/features/validation`

However if I comment out the `setFeature` for the `SchemaFactory`, setting
the feature works for the `Validator`.

So questions:

1. Why can I set the feature on the `Validator` but not on the
`SchemaFactory`?
2. Where can I find documentation of which features are valid for
`Validator` and `SchemaFactory`?

FYI: the `SchemaFactory` I am getting is
`com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory`

# EDIT

Some of the other features I have tried to set with no success are:

`http://xml.org/sax/features/namespaces`

`http://xml.org/sax/features/namespace-prefixes`

Reply via email to