This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Embedding HTML document in XSL


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]