xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pablo Emanuel <pablo.eman...@teknoland.com>
Subject Re: How do i prevent Xalan from escaping chars in CDATA sections?
Date Mon, 08 Jan 2001 23:35:40 GMT

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

- Pablo

>>>>>>>>>>>>>>>>>> Original Message

On 08/01/01, 20:15:47, JeevanK@firstlight.com wrote regarding How do i 
prevent Xalan from escaping chars in CDATA sections?:

> Hello,

> I have an XML file with a CDATA section.  The CDATA section includes a
> bunch of HTML, some of which is ill-formed according to XML standards.  I
> want to translate this xml file, leaving the CDATA completely intact, 
> and all.

> Unfortunately, when I try this, all the <'s, >'s, and other escapable
> characters get turned into their respective character references.  That 
> to say, if I have:

> <cdata_section>
>      <![CDATA[
>           <p> a bunch of HTML
>           <h2> it's not "well-formed" </h2>
>      ]]>
> </cdata_section>

> in my original XML file, it gets transformed into:

> <table>
>      &lt;p&gt; a bunch of HTML
>      &lt;h2&gt; it's not &quot;well-formed&quot; &lt;/h2&gt;
> </table>

> I have an xsl command along these lines:

> <xsl:template match="cdata_section">
> <table><xsl:apply-templates /> </table>
> </xsl:template>

> instead of <xsl:apply-templates />, i've tried <xsl:value-of select="." 
> and <xsl:copy-of select="." /> but the result is the same.

> All the tag-like characters have been transformed into their references.
> I've tried messing with OutputFormats (making cdata_section a
> nonEscapingElement and such) and changing the entities file in the xsl
> stylesheet to no avail.

> Any help?  There's got to be an option or a switch buried amidst the code
> somewhere to disable this unwanted translation, right? I found nothing 
> worked in the API docs.  I'm trying to pass this data through so that the
> parser doesn't barf on ill-formed tags and so that the data can 
> be properly displayed in an HTML browser.

> Apologies for the lengthiness of this post.

> you can respond directly to jeevank@firstlight.com if you'd like.

> thanks in advance,
> jeevan kalanithi

> First Light Communications
> jeevank@firstlight.com
> 212.766.2380 (p)
> 212.766.2379 (f)

> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

View raw message