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: xml to html paragraphing


David,
>  I resolved the problem by writing a small,
>client-side JavaScript function that takes the "escaped" HTML and converted
>it to valid HTML using the client-side DHTML DOM.

You shouldn't need to do that.

<?xml version="1.0" encoding="UTF-8"?>
<doc>
	<text>
	<![CDATA[
	<p>
	 para 1
	</p>
	<p>
	 para 2
	</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">
<doc>
	<xsl:apply-templates />
</doc>
</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


 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]