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

Can not compile stylesheet containing the { character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • 6, 7
    • xml

      FULL PRODUCT VERSION :
      java version " 1.7.0_09 "
      Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
      Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

      Or

      java version " 1.7.0_09 "
      Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
      Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      The xalan engine of the vm (com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl class) can't compile a stylesheet that defines a xml attribute that uses the " xsl:concat " fonction having a string type parameter that contain the { character.

      Not supported:
      <xsl:template match= " / " >
      <images dir= " {concat('{dummy}/',@subdir)} " />
      </xsl:template>

      When you replace '{dummy}' by 'dummy}' it's Ok

      The not supported syntax is supported by Xalan 2.7.1 and msxml


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Use the Xalan JRE engine to transform a valid xml with the steelshit below (I have create for the test a class that use the " _main " method of the com.sun.org.apache.xalan.internal.xslt.Process class)

      <?xml version= " 1.0 " encoding= " UTF-8 " standalone= " no " ?>
      <xsl:stylesheet version= " 1.0 "
      xmlns:xsl= " http://www.w3.org/1999/XSL/Transform "
      xmlns:var= " http://www.w3.org/TR/xhtml1/strict "
      exclude-result-prefixes= " var " >

      <xsl:output method= " xml " indent= " yes " omit-xml-declaration= " no " encoding= " UTF-8 " />

      <xsl:template match= " / " >
      <images dir= " {concat('{dummy}/',@subdir)} " />
      </xsl:template>

      </xsl:stylesheet>


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Something like that (depend of the XML)
      <?xml version= " 1.0 " encoding= " UTF-8 " ?><images dir= " {dummy}/ " />
      ACTUAL -
      The error bellow

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      javax.xml.transform.TransformerConfigurationException: Impossible de compiler la feuille de style
      at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source)
      at com.sun.org.apache.xalan.internal.xslt.Process._main(Unknown Source)
      at xslt.XalanJreProcess.main(XalanJreProcess.java:8)


      REPRODUCIBILITY :
      This bug can be reproduced always.

            joehw Joe Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: