XML : XSL transformation failing in Oracle 11g

I use XSLT transformation for creating html content from XML data. The transformation works perfectly in Oracle 10g. But, it fails to produce the html content in Oracle 11g. Gives the follow error

LPX-00660: Not a well-formed document or external entity.

Here is a sample code

  declare  output clob;     begin         select XMLTRANSFORM(XMLType('<?xml version="1.0" encoding="utf-8"?>' ||     '<DATA>' ||     '    <ROWSET>' ||     '        <ROW>' ||     '            <TIME_CURRENT>04-DEC-2015 06:42 AM</TIME_CURRENT>' ||                 '        </ROW>' ||     '    </ROWSET>' ||     '</DATA>'), '<?xml version="1.0" encoding="utf-8"?>' ||     '<xsl:stylesheet version="1.0"' ||     '    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">' ||     '   <xsl:output method="html" encoding="UTF-8" indent="yes"' ||     '        doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"' ||     '        doctype-system="http://www.w3.org/TR/html4/loose.dtd" />' ||     '    <xsl:template match="DATA">' ||     '        <p>' ||     '            Time Now:' ||     '            <xsl:value-of select="ROWSET/ROW/TIME_CURRENT" />' ||     '        </p>' ||     '            <xsl:call-template name="create_table"></xsl:call-template>'        ||     '    </xsl:template>' ||     '    <xsl:template name="create_table">' ||     '            <br/>' ||     '            Total row count = <xsl:value-of select="count(ROWSET/ROW)"        />' ||     '    </xsl:template>' ||     '</xsl:stylesheet>').getClobval() into output from dual;     dbms_output.put_line(output);     end;    

I found that the transformation was failing at the <br/> tag.

     '    <xsl:template name="create_table">' ||     '            <br/>' ||     '            Total row count = <xsl:value-of select="count(ROWSET/ROW)"        />' ||     '    </xsl:template>'    

When I remove this, the transformation works fine. Since, the output is required as html, removing any such tags from the code is not a solution for me.

Oracle 10g version = 10.2.0.5.0

Oracle 11g version = 11.2.0.4.0

Any help will be appreciated.

Thanks

No comments:

Post a Comment