xsl-list
[Top] [All Lists]

Re: [xsl] Re: Un-cdata-section-elements

2006-03-22 15:23:55
On 3/22/06, David Carlisle <davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
a) They will only do that (unless something strange is happening) if
   if you have specified script as a cdata-section-element in your
   xsl:stylesheet attributes.

What I have is a template that match a whole bunch of stuff, <script>
being only one of many ;

<xsl:template 
match="body|link|a|table|tr|td|dt|dl|th|div|span|p|img|ul|li|em|b|i|u|strong|h1|h2|h3|h4|h5|h6|script|noscript|form|input|br|hr|object|param|embed|sup|map|area|style">

But in the output *only* <script> gets a CDATA section thrown in; I
don't think it's wrong to assume the processor puts this in when
converting the output node tree? There is no other special rule or
anything different about the handling of the <script> contents; it's
just like anything else. My output statement is what you'd expect ;

        <xsl:output method="xml" indent="yes" encoding="utf-8"
omit-xml-declaration="yes"
                doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
                
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
         />

b) they won't do that at all and they will generate exactly what you
   said you wanted if they support disable-output-escaping and you use the
   construct that I showed
<xsl:text disable-output-escaping="yes"><![CDATA[
//<![CDATA[
  ..... stuff here ...
//]]>]]&gt;
</xsl:text>

Yes, but this becomes tricky as the template is not only for one
element. (see above)


Alex
--
"Ultimately, all things are known because you want to believe you know."
                                                         - Frank Herbert
__ http://shelter.nu/ __________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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