8 Replies Latest reply: Sep 17, 2012 6:49 AM by odie_63 RSS

    Bug when copying processing-instruction() nodes via XSLT

    odie_63
      Hi,

      Database version :
      BANNER
      --------------------------------------------------------------------------------
      Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
      PL/SQL Release 11.2.0.2.0 - Production
      CORE     11.2.0.2.0     Production
      TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
      NLSRTL Version 11.2.0.2.0 - Production
      Test case (XSLT identity transform) :
      SELECT XMLSerialize(document
               XMLTransform(
                 XMLParse(document '<test><?abc?></test>')
               , XMLParse(document 
      '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="xml"/>
        <xsl:template match="@*|node()">
          <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
          </xsl:copy>
        </xsl:template>
      </xsl:stylesheet>')
               )
             ) as result
      FROM dual;
      produces :
      RESULT
      --------------------------------------------------------------------------------
      <?xml version="1.0" encoding="utf-8"?>
      <?abc ?><test></test>
       
      instead of the expected output, with the processing-instruction() node at the right place, in document order :
      <?xml version = "1.0" encoding = "UTF-8"?>
      <test><?abc ?></test>
      Any ideas or workarounds?

      Thanks.