xsl-list
[Top] [All Lists]

Re: outputting CDATA section

2003-04-22 10:19:28

From: "Nathan Shaw" <n8_shaw(_at_)yahoo(_dot_)com>

I am trying to transform xml to xml and the end schema
dictates that I have to put all of my actual content
(HTML page) into an element like this:

<property name="body"><[[CDATA[ potentially nasty,
ill-formed HTML ]]></property>


  <xsl:template match="content">
    <xsl:element name="property">
      <xsl:attribute name="name">
        <xsl:value-of select="'body'"/>
      </xsl:attribute>
      <xsl:text
disable-output-escaping="yes">&lt;![CDATA[<![CDATA[<html><body><p>Mal-formed
content.</body></html>]]>]]&gt;</xsl:text>
    </xsl:element>
  </xsl:template>


But I don't think it will be possible to get your mal-formed HTML in there
without writing it out just as I have done.  Any construct you might use to
substitute it, a passed parameter or variable assignment, is going to verify
well-formedness of its argument when declared.


hth,

Mike


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



<Prev in Thread] Current Thread [Next in Thread>