Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to stop entity escaping with XML Parser

Status
Not open for further replies.

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=&quot;init('somevalue')&quot;>
...
</body>

but the Parser always escapes it to:
<body onload=&quot;init(&apos;somevalue&apos;)&quot;>
...
</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

<xsl:eek:utput method=&quot;html&quot;>
and
<xsl:eek:utput method=&quot;xml&quot;>

in the stylesheet but neither work.

Tried:
<body>
<xsl:attribute name=&quot;onload&quot;><xsl:text disable-output-escaping=&quot;yes&quot;>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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top