Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8167179

Make XSL generated namespace prefixes local to transformation process

    Details

    • Subcomponent:
    • Resolved In Build:
      b142

      Backports

        Description

        Transformations that utilizes 'namespace-uri()' function generates different namespace prefixes.
        As a result subsequent transformations of the same XML content with the same XSL will result in different content generated.
        The example of two subsequent iterations results can be:
        Iteration 1:
        <?xml version="1.0" encoding="UTF-8"?>
        <ns0:TestRoot xmlns:ns0="test.xmlns">
        <ns1:Element1 xmlns:ns1="test.xmlns">
        </ns1:Element1>
        <ns2:Element2 xmlns:ns2="test.xmlns">
        </ns2:Element2>
        </ns0:TestRoot>

        Iteration 2:
        <?xml version="1.0" encoding="UTF-8"?>
        <ns3:TestRoot xmlns:ns3="test.xmlns">
        <ns4:Element1 xmlns:ns4="test.xmlns">
        </ns4:Element1>
        <ns5:Element2 xmlns:ns5="test.xmlns">
        </ns5:Element2>
        </ns3:TestRoot>

        Such behavior can lead to the high memory usages by cached transformer/templates instances: The unique namespace prefixes will be stored in Xerces SymbolTable associated with the cached transformer. The BasisLibrary::generatePrefix method should be fixed to generate the same prefixes numbers for each transformation operation, i.e. the prefix index counter should be made thread local and needs to be reset during the start of each transformation process.

          Activity

          Show
          aefimov Aleksej Efimov added a comment - Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-October/044239.html
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jaxp/rev/bdafa0cc34a9
          User: aefimov
          Date: 2016-10-20 23:59:16 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jaxp/rev/bdafa0cc34a9 User: aefimov Date: 2016-10-20 23:59:16 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jaxp/rev/bdafa0cc34a9
          User: lana
          Date: 2016-10-26 20:16:00 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jaxp/rev/bdafa0cc34a9 User: lana Date: 2016-10-26 20:16:00 +0000
          Hide
          afomin Alexander Fomin added a comment -
          SQE OK: No issues found with the fix during 7u121 b32 BPR testing.
          Show
          afomin Alexander Fomin added a comment - SQE OK: No issues found with the fix during 7u121 b32 BPR testing.

            People

            • Assignee:
              aefimov Aleksej Efimov
              Reporter:
              shadowbug Shadow Bug
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: