Microsoft KB Archive/264665

= How To Display HTML in XSL Style Sheet =

Article ID: 264665

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft XML Parser 2.5
 * Microsoft XML Core Services 4.0
 * Microsoft XML Core Services 4.0

-



This article was previously published under Q264665



SUMMARY
When XML data contains HTML tags, those tags are considered as plain data by default, and are not parsed as HTML. The output displays as text without HTML effects. This article explains how to work with the XSL style sheets to use the HTML tags that are inside XML data.



MORE INFORMATION
In the xsl:value-of element, use the XSL disable-output-escaping property, and then set it to yes. By default disable-output-escaping is set to no. This property was added with the May 2000 version of the Microsoft XML parser.

You may install the latest version of the MS XML parser from the following:

http://msdn.microsoft.com/xml/default.asp


 * Run the Msxmlwr.exe file that you downloaded.
 * Run the Xmlinst.exe file that is saved under the Winnt\System32 folder.

The following XML/XSL example demonstrates how to work with the XSL style sheets to use the HTML tags that are inside XML data: Here is the XML file that we want to display...

=
=============================================================  

=
============================================================= The HTML data in the first  line can be written with special character sequences and CDATA section, as demonstrated in the following examples:


 * &lt;H1&gt;This is a H1 heading&lt;/H1&gt;
 * 

Note that characters such as are reserved characters in XML, and are not interpreted if they are placed in an XML file. Substitute these characters with case-sensitive character sequences. For more information on Microsoft's work with XML, refer to the XML SDK, available on MSDN Online at the following Web site:

http://www.microsoft.com/isapi/redir.dll?prd=xml

The following is the corresponding TestHTML.xsl file that demonstrates how to work with the XSL style sheets to use the HTML tags that are inside XML data: ==========================================================================        </xsl:stylesheet>

=
=============================================================

<div class="references_section">