RE: [xsl] Group Techniques by xslt

Subject: RE: [xsl] Group Techniques by xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 4 Dec 2009 09:00:15 -0000
>  We have modified the line where you are generating element 
> (<sc[0-9]>) and it is working fine. I want your expert 
> comments on this, whether this can cause any problem.

There are several things badly wrong with using disable-output-escaping:

(a) it doesn't work in all environments and on all processors. In
particular, it only works if the output of the stylesheet is being
serialized. This means for example that it doesn't work in Firefox, which
renders the result tree directly without first generating serialized HTML.

(b) in consequence of this, your stylesheet code is less reusable, it can't
be combined with other code to produce a more complex transformation
pipeline, because it will only operate as the last step in the pipeline

(c) it runs against the architecture of the language; it means you can
generate invalid or non-well-formed output; it reduces the scope of the
processor for optimization; it makes your code less readable.

(d) it's deprecated.

(e) if you take the trouble to learn how to use the language properly, it is
almost always unnecessary (and that's certainly true here.)

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 

> 
>   <xsl:if test="self::p[matches(@class,'^Head[0-9]+$')]">
>    <xsl:text
> disable-output-escaping="yes"><![CDATA[<sc]]></xsl:text><xsl:value-of
> select="$level"/>
>    <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
>   </xsl:if>
>   <!--<xsl:element name="sc{$level}">-->
>    
>     ......
> 
>   <!--</xsl:element>-->
>   <xsl:if test="self::p[matches(@class,'^Head[0-9]+$')]">
>    <xsl:text
> disable-output-escaping="yes"><![CDATA[</sc]]></xsl:text><xsl:value-of
> select="$level"/>
>    <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
>   </xsl:if>
> 
> Thanks a lot!!!
> 
> Thanks
> ...JSR

Current Thread