[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Embedding HTML document in XSL


Subject: Re: Embedding HTML document in XSL
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 11 Aug 2000 10:47:28 -0600 (MDT)

Sunitha wrote:
> Hi all,
> Could anyone help me out with my problem.
> I want to embed an HMTL doucment into and XSL stylesheet.
> Is it possible?

FAQ. 

The correct/elegant way is to make the HTML well-formed XML by following
the guidelines of the XHTML 1.0 Recommendation.

http://www.w3.org/TR/xhtml1/

Then you can copy the whole thing with xsl:copy-of.


If you must use poorly-formed data and you do not need to access the
internal structure of the HTML, and if you are using an XSLT 1.0 processor
(*not* IE5's default processor), you have the option of making the HTML be
a single block of character data:

<![CDATA[<BODY><P><BR>very bad HTML</LI></HEAD>]]>

which you can then put into a text node with an instruction to the XSLT
processor to flag that text node as not having its content subjected to
the escaping that might otherwise occur upon output, depending on the
output method chosen:

<xsl:text disable-output-escaping="yes"><![CDATA[bad html goes here]]></xsl:text>

or, if the data is in the source tree:

<xsl:value-of select="." disable-output-escaping="yes"/>

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords