Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2343

[PATCH]: Issues with DOM L3 "entities" and "infoset" parameters.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7.1
    • DOM, Serialization
    • 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.

      Attachments

        1. ls-serializer-entities-infoset-patch.txt
          9 kB
          Michael Glavassevich

        Activity

          People

            minchau@ca.ibm.com Brian Minchau
            mrglavas@ca.ibm.com Michael Glavassevich
            Brian Minchau Brian Minchau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: