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

Tag <xsl:element> with dynamic element name does not Work.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.2
    • xml

      Name: gm110360 Date: 11/06/2003


      FULL PRODUCT VERSION :
      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

      FULL OS VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :

      javax.xml.transform.Transformer in JAXP API does not work with XSLT tag <xsl:element>.

      It is not possible using the tag <xsl:element name="{$varName}"> with dynamic element name.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Using following xslt source produces the error "Unknown SystemId; ... Invalid value for attribute name":

      XSLT SOURCE:
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
          <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
          <xsl:template match="child::foo">
              <xsl:variable name="elemName" select="."/>
              <xsl:element name="{$elemName}"/>
          </xsl:template>
      </xsl:stylesheet>

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      For input
      <foo>...</foo>

      the output of the transformation should be:
      <foo/>

      REPRODUCIBILITY :
      This bug can be reproduced always.
      (Incident Review ID: 193902)
      ======================================================================

            ayadavsunw Arun Yadav (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: