Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. transformed cdata content not escaping properly (or atleast the way i want it it)

transformed cdata content not escaping properly (or atleast the way i want it it)

Scheduled Pinned Locked Moved XML / XSL
xmlhelpdockerregex
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nyhtal
    wrote on last edited by
    #1

    need a little help with this one please. i have an xml document that contains nodes with cdata sections and am transforming it with xsl. i can get the cdata section to render properly by using <xsl:value-of select="content" disable-output-escaping="yes"/> in my xsl:template but if i try to pass the results of that template to another template my cdata section becomes escaped. i tried converting the cdata section to an escaped attribute in my xml but get the same problem. even an answer of "sorry, not possible." is greatful as i've been trying everything i can think of to get this to work and have come up with nothing. i can restructure my xml if need be, only i cannot convert the cdata content to valid xml (it needs to be escaped). sample code: <xsl:template match="/"> <xsl:variable name="myStructuredContent"><xsl:call-template name="GetStructuredContent"/></xsl:variable> <xsl:call-template name="Container_RoundedCorners"> <xsl:with-param name="content" select="$myStructuredContent"> </xsl:call-template> </xsl:template> <xsl:template name="GetStructuredContent"> <h2><xsl:value-of select="title"/></h2> <div><xsl:value-of select="content" disable-output-escaping="yes"/></div> <div><a href="{morelinkhref}"><xsl:value-of select="morelinktext"/></a></div> </xsl:template> <xsl:template name="Container_RoundedCorners"> <xsl:param name="content"/> <div class="RoundedCornerTopLeft"><div class="RoundedCornerTopRight"><xsl:copy-of select="$content"/></div></div> </xsl:template> thanks a bazillion in advance.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups