RE: [xsl] HTML in CDATA

Subject: RE: [xsl] HTML in CDATA
From: "Tim Watts" <timw@xxxxxxx>
Date: Wed, 13 Jun 2001 09:54:39 +1000
He actually mentioned "legacy HTML"

That is tags which are legacy are those which don't have a closing tag, such
as <img src="hjjsa.gif"> To make then conform to XML, the HTML 4.0 should be
typed as XHTML.

If a tag doesn't have a match, then the notation <whatever /> can be used

<img src="hjjsa.gif"> becomes <img src="hjjsa.gif" />
<hr> becomes <hr />
<br> becomes <br />

That also means that instead of <article><![CDATA[Test News<br><br>Test
News<br><br>Test News]]></article> you could simply write
<article>Test News<br /><br />Test News<br /><br />Test News</article>

and avoid the CDATA sections completely.

Anyway, most HTML requires end tags anyway ie.

Hope that helps,

Tim :)

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Williams,
Sent: Wednesday, 13 June 2001 2:08 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: RE: [xsl] HTML in CDATA


You mentioned that XSLT was not the best tool for mixing HTML and XML. What
would you recommend using when you need to display XML with images,
graphics, tables, etc... in a browser?



-----Original Message-----
From: Mike Brown [mailto:mike@xxxxxxxx]
Sent: Monday, June 11, 2001 7:00 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] HTML in CDATA

Robert Dahnke wrote:
> If I have HTML in a CDATA region like here:
> <article><![CDATA[Test News<br><br>Test News<br><br>Test News]]></article>

CDATA sections are just a convenience so that you don't have to escape the
markup in the source document. It doesn't make the character data mean
anything different than

  Test News&lt;br&gt;&lt;br&gt;Test News etc etc.

If you want to produce non-well-formed output like you describe, you need
to use disable-output-escaping="yes" when you create the text node with
value-of. Ideally you should not be trying to embed one form of SGML in
another. XSLT is not the best tool for mixing legacy HTML with XML.

   - Mike
mike j. brown, software engineer at  |  xml/xslt: in denver, colorado, USA    |  personal:

 XSL-List info and archive:

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread