Project

Profile

Help

Bug #2414

closed

org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing

Added by O'Neil Delpratt almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JAXP Java API
Sprint/Milestone:
Start date:
2015-07-09
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

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.

Actions #1

Updated by Michael Kay almost 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).

Actions #2

Updated by O'Neil Delpratt over 8 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.

Actions #3

Updated by O'Neil Delpratt over 8 years ago

  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.7 added
Actions #4

Updated by O'Neil Delpratt over 8 years ago

  • Sprint/Milestone set to 9.6.0.7

Please register to edit this issue

Also available in: Atom PDF