Guest_imported
New member
- Jan 1, 1970
- 0
Hi,
I'm using the Oracle XML parser for PL/SQL to take an XML document and XSLT document stored as CLOBs in a table, transforming the XML using the XSLT document to get a resultant HTML clob. All is well apart from the XSLT Processor always escapes any XML entities found in attribute values of tags. eg:
in the XSLT there is a literal tag:
<body onload="init('somevalue')">
...
</body>
but the Parser always escapes it to:
<body onload="init('somevalue&apos">
...
</body>
which makes the browser javascript error because it is not converting the entities back. So I need to get the parser to stop doing this. It doesn't do it for element content - only attribute values. Tried using Microsoft's parser and the XSLT works fine. But I need to use the Oracle parser.
Tried using
<xslutput method="html">
and
<xslutput method="xml">
in the stylesheet but neither work.
Tried:
<body>
<xsl:attribute name="onload"><xsl:text disable-output-escaping="yes">init('somevalue')</xsl:text></xsl:attribute>
...
</body>
but it too doesn't work!
As a hack I'm just doing a search and replace on the resultant HTML to replace the entity with the character but I'm not happy about this solution.
Any ideas?
Cheers
Ian
I'm using the Oracle XML parser for PL/SQL to take an XML document and XSLT document stored as CLOBs in a table, transforming the XML using the XSLT document to get a resultant HTML clob. All is well apart from the XSLT Processor always escapes any XML entities found in attribute values of tags. eg:
in the XSLT there is a literal tag:
<body onload="init('somevalue')">
...
</body>
but the Parser always escapes it to:
<body onload="init('somevalue&apos">
...
</body>
which makes the browser javascript error because it is not converting the entities back. So I need to get the parser to stop doing this. It doesn't do it for element content - only attribute values. Tried using Microsoft's parser and the XSLT works fine. But I need to use the Oracle parser.
Tried using
<xslutput method="html">
and
<xslutput method="xml">
in the stylesheet but neither work.
Tried:
<body>
<xsl:attribute name="onload"><xsl:text disable-output-escaping="yes">init('somevalue')</xsl:text></xsl:attribute>
...
</body>
but it too doesn't work!
As a hack I'm just doing a search and replace on the resultant HTML to replace the entity with the character but I'm not happy about this solution.
Any ideas?
Cheers
Ian