forked from FasterXML/aalto-xml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: map SAX external-general-entities feature to new custom par…
…ameter meant for retaining entities instead of misusing the StAX XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES feature Refs: FasterXML#65
- Loading branch information
Showing
9 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
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,10 @@ | ||
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 { | ||
public final static String EXPAND_GENERAL_ENTITIES = "com.fasterxml.aalto.expandGeneralEntities"; | ||
} |
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
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")); | ||
} | ||
|
||
} |