Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I make my XSLT processor accept html code ?

158113Jan 14 2002
In my applications the Oracle xslt processor wont accept simple HTML tags within an XML source while transforming the source into HTML. Both processors either will throw parser exceptions or ignore the HTML code in the XML source completely, though output-escaping is explicitly enabled.

In detail, I want to transform an XML source like this...
<element>
Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
</element>

... with an XSL Stylesheet like this...
<xsl:stylesheet>
<xsl:output method=html cdata-sections=element/>
<xsl:template match=element>
<html>
<body>
<xsl:value-of select=. output-escaping=yes/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

... which should result in a HTML code like this ...
<html>
<body>
Hello, this is a <b>XML</b> text source mingled with html<sup>TM</sup>
</body>
</html>

The result, however, is always like this:
<html>
<body>
Hello, this is a XML text source mingled with htmlTM
</body>
</html>

This means that the additional HTML tags inside the XML source have been completely ignored by the XSLT processor though I enabled the output-escaping.

If anybody should think now that mingling HTML with XML text is stupid because I could also format the result with the XSL Stylesheet itself, he might be right, of course, but: I cant avoid this because in my application the XML source results from a users web form entry. The user working with the form must be able to decide whether he wants to include HTML in his text or not. In any case, any HTML code he enters should just be transported WITHOUT ANY CHANGES to the resulting HTML page, not omitted without comments! It seems quite simple to me, but the XSLT processor doesnt want to agree with me in this point :-(

So, once again in brief: Is there any possibility to tell my XSLT processor not to parse, transform or manipulate HTML tags, but to transport them unchanged to the output ?

After weeks of research any helping sign would be a great relief...
Many thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 14 2002
Added on Jan 14 2002
3 comments
901 views