Bug #2414
closedorg.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
100%
Description
Bug reported by Jörg Godau (initially in bug issue #2411):
We need to deactivate the secure Processing, as we are dealing with files with over 10000 (tenthousand) elements. We do that with:
final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
This causes:
org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
at javax.xml.validation.SchemaFactory.setFeature(SchemaFactory.java:390)
Mike's response:
We should probably treat this as a bug, since the Javadoc does say that all implementations are expected to recognize this feature (and by implication, recognize a request to switch it off). But your application should work fine, I think, if you just avoid this call, or ignore the exception if it fails. There's a possibility that the underlying parser might impose size limits on the XML, but we've validated gigabyte-sized files without hitting any limits, so I would be surprised.
Updated by Michael Kay over 9 years ago
- Category changed from Schema-Aware processing to JAXP Java API
- Status changed from New to Resolved
- Assignee set to Michael Kay
I have added SchemaFactoryImpl.getFeature() and setFeature() to recognize this property; the value is mapped to the Configuration property named by the concatenated string
FeatureKeys.XML_PARSER_FEATURE + XMLConstants.FEATURE_SECURE_PROCESSING
Note that (a) setting a value affects the Configuration globally, and (b) setting a value only affects things if the XML parser is allocated by the Configuration (not for example if it is passed in as part of a SAXSource object representing a schema document or source document).
Updated by O'Neil Delpratt over 9 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in version set to 9.6.0.7
Bug fix applied in the Saxon 9.6.0.7 maintenance release.
Updated by O'Neil Delpratt about 9 years ago
- Applies to branch 9.6 added
- Fix Committed on Branch 9.6 added
- Fixed in Maintenance Release 9.6.0.7 added
Please register to edit this issue