This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xml to html paragraphing
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] xml to html paragraphing
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Thu, 29 Mar 2001 22:46:06 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
David,
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<text>
<![CDATA[
<p>
para 1
</p>
<p>
para 2
<!--No closing P-->
]]>
</text>
</doc>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="doc">
<html>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="text">
<xsl:value-of disable-output-escaping="yes" select="." />
</xsl:template>
</xsl:stylesheet>
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
>-----Original Message-----
>From: owner-xsl-list@lists.mulberrytech.com
>[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Pinch, David
>Sent: 29 March 2001 20:37
>To: xsl-list@lists.mulberrytech.com
>Subject: RE: [xsl] xml to html paragraphing
>
>
>
>David Carlisle [davidc@nag.co.uk] said:
>
>> You could probably just have used the
>> disable-output-encoding attribute
>> in XSLT to save using javascript, but this is
>> only a last resort when it
>> isn't possible to fix the source not to
>> have CDATA sections.
>
>I am fetching the user-submitted HTML for display on a web page. The XSLT
>is generating surrounding elements (e.g., a navigation bar) in addition to
>the user HTML. I have no guarantee that the user entered well-formed HTML,
>and I don't trust Microsoft's DOM. I'd rather have a forgiving-browser
>display poorly-formed HTML, than have the entire XSL sheet abort and lose
>the page.
>
>Of course, the JavaScript hack isn't exactly the fastest possible approach
>-- lots of string processing depending on the technique. And it's probably
>dependent on Internet Explorer (ulg). Worse comes to worse, I could always
>generate the HTML at the server (e.g., in ASP or JSP) and submit
>it directly
>to the HTTP stream. But for some reason I like the pure-XSLT approach with
>the web server only acting as a document server.
>
>Thanks for the reply.
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list