[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] CDATA


Subject: [xsl] CDATA
From: Jim Han <jhan@xxxxxxxxxxxxxxxx>
Date: Wed, 9 Apr 2003 10:48:59 -0500

I need help outputing CDATA as HTML(Recognized as HTML).

Here's my xml:
<Article>
	<Title>The Blue Thunder Story</Title>
	<Type>
		<Name>Feature</Name>
		<Section>Product Focus</Section>
	</Type>
	<Pages>
		<Page No="0">
			<Title>Perfection Obsession</Title>
			<Content><![CDATA[
				<table width="520" border="0"
cellpadding="0" cellspacing="0">
				  <tr>
				    <td width="520" valign="top">
				      <p>&quot;Originally there was no
intention to market and sell car fuel,&quot;
				        said Horizon Engineering Manager,
John Adams. &quot;We just wanted a fuel
				        to race with - a fuel that was
better than what was on the market, that
				        was consistent from gallon to gallon
and a fuel that we could easily get.
				        What we ended up with was a fuel
that had several unique properties that
				        actually made tuning engines easier.
When industry leaders like Ron Paris
				        and several factory gas car teams
tried the fuel, they were the ones who
				        actually convinced us to market and
sell the fuel.&quot;</p>
				    </td>
				  </tr>
				</table>
			]]></Content>
		</Page>
	</Pages>
</Article>

My XSL: 
<xsl:stylesheet version = "1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="Article"> 
		 <h1>
			  <xsl:value-of select="Title"/>
		 </h1> 
		 <h2>
			  <xsl:value-of select="Posted"/>
		 </h2>		 
		 <h2>
			  <xsl:value-of select="Author"/>
		 </h2> 
		 
		 <xsl:apply-templates select="Pages"/>
	</xsl:template>
	
	<xsl:template match="Pages"> 
		<xsl:apply-templates select="Page"/>
	</xsl:template>	
	
	<xsl:template match="Page"> 
		 <h3>
			  <xsl:value-of select="Title"/>
		 </h3> 
		 
		  <xsl:value-of select="Content"/>
	</xsl:template>		
</xsl:stylesheet> 

But my output in the browser is:

The Blue Thunder Story
03/19/2003
Perfection Obsession
<table width="520" border="0" cellpadding="0" cellspacing="0"> <tr> <td
width="520" valign="top"> <p>&quot;Originally there was no intention to
market and sell car fuel,&quot; said Horizon Engineering Manager, John
Adams. &quot;We just wanted a fuel to race with - a fuel that was better
than what was on the market, that was consistent from gallon to gallon and a
fuel that we could easily get. What we ended up with was a fuel that had
several unique properties that actually made tuning engines easier. When
industry leaders like Ron Paris and several factory gas car teams tried the
fuel, they were the ones who actually convinced us to market and sell the
fuel.&quot;</p> </td> </tr> </table> 


How can I get above CDATA to be recognized as HTML in the browser?
The reason why I put the content in cdata is that our article has different
html formats.

Thank you!

Jim Han



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



Current Thread