Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   xsl:output cdata-section-elements (http://www.velocityreviews.com/forums/t366914-xsl-output-cdata-section-elements.html)

werD 08-27-2006 03:02 AM

xsl:output cdata-section-elements
 
Hello,
Ive been reading about cdata-section-elements b/c ive got a comments
field that id like to inlcude some html in. For some reason the final
output is not including any cdata tags though? The original field that
this is pulled from does use cdata tags but they dont seem to come
through

Is this possible or is there something im missing?


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="no" method="xml"
cdata-section-elements="comments"/>
<xsl:template match="/">
<data>

<xsl:for-each select="data/supervisors/supentry">

<entry>
<id><xsl:value-of select="@id"/></id>
<author>
<xsl:value-of select="@author"/>
</author>
<xsl:element name="comments">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:element>
</entry>
</data>


thanks

drewg


Martin Honnen 08-27-2006 11:23 AM

Re: xsl:output cdata-section-elements
 


werD wrote:


> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output omit-xml-declaration="no" method="xml"
> cdata-section-elements="comments"/>



> <xsl:element name="comments">
> <xsl:value-of select="." disable-output-escaping="yes"/>
> </xsl:element>


Do you get a CDATA section in the output if you don't use
disable-output-escaping="yes"?

--

Martin Honnen
http://JavaScript.FAQTs.com/

Peter Flynn 08-27-2006 07:04 PM

Re: xsl:output cdata-section-elements
 
werD wrote:
> Hello,
> Ive been reading about cdata-section-elements b/c ive got a comments
> field that id like to inlcude some html in.


FAQ. See http://xml.silmaril.ie/authors/cdata/

> For some reason the final
> output is not including any cdata tags though? The original field that
> this is pulled from does use cdata tags but they dont seem to come
> through
>
> Is this possible or is there something im missing?


It's correct behaviour.

///Peter

werD 08-27-2006 08:50 PM

Re: xsl:output cdata-section-elements
 
Thanks,
When I remove disable-output-escaping it doesn't add the cdata but it
did break down the html to its character form which will be sufficient.
Thanks for your post

Martin Honnen wrote:
> werD wrote:
>
>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > <xsl:output omit-xml-declaration="no" method="xml"
> > cdata-section-elements="comments"/>

>
>
> > <xsl:element name="comments">
> > <xsl:value-of select="." disable-output-escaping="yes"/>
> > </xsl:element>

>
> Do you get a CDATA section in the output if you don't use
> disable-output-escaping="yes"?
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/



werD 08-28-2006 03:04 AM

Re: xsl:output cdata-section-elements
 
Thanks
Peter Flynn wrote:
> werD wrote:
> > Hello,
> > Ive been reading about cdata-section-elements b/c ive got a comments
> > field that id like to inlcude some html in.

>
> FAQ. See http://xml.silmaril.ie/authors/cdata/
>
> > For some reason the final
> > output is not including any cdata tags though? The original field that
> > this is pulled from does use cdata tags but they dont seem to come
> > through
> >
> > Is this possible or is there something im missing?

>
> It's correct behaviour.
>
> ///Peter




All times are GMT. The time now is 01:30 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.