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: HTML in CDATA


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

Thus
<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.
<table><tr><td></td></tr></table>

Hope that helps,

Tim :)

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


Mike,

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?

Thanks,

Brad

-----Original Message-----
From: Mike Brown [mailto:mike@skew.org]
Sent: Monday, June 11, 2001 7:00 PM
To: xsl-list@lists.mulberrytech.com
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: http://skew.org/xml/
webb.net in denver, colorado, USA    |  personal:
http://hyperreal.org/~mike/

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



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


 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]