• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 578
  • Last Modified:

How to render HTML tags from XML in an XSLT transformation?

I have a small XSLT file that has an output method set as follows:

      <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

The problem that I have is that the XSLT file is transformed against XML from a database. This XML contains html tags such as <strong and <b and the tags are displayed in the output of the page. What I want is for the result of the transform to result in the HTML tags being applied in the output.

For example, The <u>knees</u> are <em>good</em> for walking should be displayed in the output with the knees underlined and the good bold but I get only the text with the tags as text.

The XSLT is transformed via an ASP.NET XML control.

Thanks for any help given I am really stuck.
0
blindbull
Asked:
blindbull
1 Solution
 
Geert BormansCommented:
Hi blindbull,

"The <u>knees</u> are <em>good</em> for walking"

If you see this, that means that the tags are escaped like this
"The &lt;u&gt;knees&lt;/u&gt;

in the XSLT you can switch this escaping off
if the above is eg. in element "test"
you can do this
<xsl:value-off select='test' disable-output-escaping="yes"/>
that should do the trick

Cheers!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now