xsl:output cdata-section-elements

Discussion in 'XML' started by werD, Aug 27, 2006.

  1. werD

    werD Guest

    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:eek:utput 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
     
    werD, Aug 27, 2006
    #1
    1. Advertising

  2. werD wrote:


    > <xsl:stylesheet version="1.0"
    > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    > <xsl:eek:utput 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/
     
    Martin Honnen, Aug 27, 2006
    #2
    1. Advertising

  3. werD

    Peter Flynn Guest

    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
     
    Peter Flynn, Aug 27, 2006
    #3
  4. werD

    werD Guest

    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:eek:utput 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, Aug 27, 2006
    #4
  5. werD

    werD Guest

    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
     
    werD, Aug 28, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Davison
    Replies:
    1
    Views:
    622
    Hal Rosser
    Jul 7, 2004
  2. CarlosRivera
    Replies:
    5
    Views:
    867
    CarlosRivera
    Jan 16, 2005
  3. Replies:
    2
    Views:
    1,771
    Richard Tobin
    Nov 27, 2003
  4. Tak Sze
    Replies:
    2
    Views:
    4,379
    Patrick TJ McPhee
    Apr 30, 2004
  5. Replies:
    3
    Views:
    779
    Joe Kesselman
    Mar 6, 2006
Loading...

Share This Page