-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: retain attribute entity references instead of choking when XMLIn…
…pu… (#74) Implement #65: Add AaltoInputProperties.P_RETAIN_ATTRIBUTE_GENERAL_ENTITIES which allows skipping handling of general entity references in attributes.
- Loading branch information
Showing
8 changed files
with
111 additions
and
20 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/main/java/com/fasterxml/aalto/AaltoInputProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.fasterxml.aalto; | ||
|
||
/** | ||
* Class that contains constant for property names used to configure | ||
* cursor and event readers produced by Aalto implementation of | ||
* {@link javax.xml.stream.XMLInputFactory}. | ||
*/ | ||
public final class AaltoInputProperties { | ||
|
||
/** | ||
* Feature controlling whether general entities in attributes are retained. | ||
* | ||
* @since 1.3 | ||
*/ | ||
public final static String P_RETAIN_ATTRIBUTE_GENERAL_ENTITIES = "com.fasterxml.aalto.retainAttributeGeneralEntities"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/com/fasterxml/aalto/sax/TestSAXParserFactoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.fasterxml.aalto.sax; | ||
|
||
import org.xml.sax.SAXNotRecognizedException; | ||
import org.xml.sax.SAXNotSupportedException; | ||
|
||
public class TestSAXParserFactoryImpl extends base.BaseTestCase { | ||
|
||
public void testSetGetFeatureExternalGeneralEntities() throws SAXNotRecognizedException, SAXNotSupportedException { | ||
SAXParserFactoryImpl saxParserFactory = new SAXParserFactoryImpl(); | ||
saxParserFactory.setFeature("http://xml.org/sax/features/external-general-entities", false); | ||
assertFalse(saxParserFactory.getFeature("http://xml.org/sax/features/external-general-entities")); | ||
|
||
saxParserFactory.setFeature("http://xml.org/sax/features/external-general-entities", true); | ||
assertTrue(saxParserFactory.getFeature("http://xml.org/sax/features/external-general-entities")); | ||
} | ||
|
||
} |