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>"Originally there was no intention to market and sell car fuel," said Horizon Engineering Manager, John Adams. "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."</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>"Originally there was no intention to market and sell car fuel," said Horizon Engineering Manager, John Adams. "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."</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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] CDATA, David Carlisle | Thread | [xsl] step-by-step work instruction, Kathy Burke |
[xsl] step-by-step work instruction, Kathy Burke | Date | Re: [xsl] CDATA, David Carlisle |
Month |