RE: [xsl] CDATA

Subject: RE: [xsl] CDATA
From: "Cross, Neal - Development Controller" <ncross@xxxxxxxxx>
Date: Wed, 9 Apr 2003 17:07:36 +0100
You could try escaping the output:-
<xsl:value-of select="Content" disable-output-escaping="yes"/>
It worked for me, but I have been wrong many, many times before!

-----Original Message-----
From: Jim Han [mailto:jhan@xxxxxxxxxxxxxxxx]
Sent: 09 April 2003 16:49
To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
Subject: [xsl] CDATA


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


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


Current Thread
  • [xsl] CDATA
    • Jim Han - Wed, 9 Apr 2003 10:48:59 -0500
      • <Possible follow-ups>
      • Cross, Neal - Development Controller - Wed, 9 Apr 2003 17:07:36 +0100 <=