Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
PatchAvailable
Description
Setting the "infoset" parameter to true with the current code in SVN causes the following exception when you try to serialize a document.
java.lang.RuntimeException: The resource [ ] could not load: java.lang.NumberFormatException: Listing</title>
java.lang.NumberFormatException: Listing</title>
at org.apache.xml.serializer.CharInfo.<init>(CharInfo.java:302)
at org.apache.xml.serializer.CharInfo.<init>(CharInfo.java:173)
at org.apache.xml.serializer.CharInfo$1.run(CharInfo.java:465)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.xml.serializer.CharInfo.getCharInfoBasedOnPrivilege(CharInfo.java:462)
at org.apache.xml.serializer.CharInfo.getCharInfo(CharInfo.java:526)
at org.apache.xml.serializer.ToStream.setOutputFormat(ToStream.java:603)
at org.apache.xml.serializer.dom3.LSSerializerImpl.write(LSSerializerImpl.java:958)
This exception occurs because the LSSerializer is trying to use the OutputPropertiesFactory.S_KEY_ENTITIES for a different purpose than it was intended to select whether or not to preserve entities in the document. The attached patch switches the code over to using a different non-conflicting property name and also fixes a bug in handling the "infoset" property. Setting the "infoset" property to false is supposed to have no effect, but we're setting the properties anyways as if "infoset" were set to true.