开发者

XSLT disable-output-escaping not holding across two diff servers

Gidday,

I have a page with XSLT doing small amounts of awesome, and it has mostly been going quite well, but I've hit a roadblock.

This page: http://codefinger.co.nz/_testing/build_2011/ chokes on CDATA sections that aren't actually in part of my .xsl file, they seem to be inserted during transformation (Javascript parse errors thrown).

Interestingly, this SO question: xslt, javascript and unescaped html entities solved the problem on my local test site (I wrapped the contents of my script blocks with the disable-output-escaping XSL tags), which is a WAMP 2.0 stack with this XSL config:

XSLT disable-output-escaping not holding across two diff servers

My live, hosted server has this config: http://codefinger.co.nz/php-info.php, and this same approach does not work.

Here's the source .xsl file: http://codefinger.co.nz/_testing/build_2011/xsl/siteContent.xsl, the associated .xml is valid, it is here: http://codefinger.co.nz/_testing/build_2011/xml/siteContent.xml.

Any ideas?

It should be noted that I really don't fancy moving 2 of the 3 scripts blocks to external files - one is Cuf开发者_开发问答on font replacement (so I could move it), the other is a wee script in the head tag by Luke Smith, which is converted to CSS when JS is available.


Use CDATA sections in your <xsl:text> elements Like this:

<xsl:text disable-output-escaping="yes"><![CDATA[
    ..... 
]]></xsl:text> 

In the comments above, you found yourself that this is even better:

<xsl:comment><![CDATA[
    ..... 
]]></xsl:comment>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜