[xsl] Serializing <script> elements to HTML

Subject: [xsl] Serializing <script> elements to HTML
From: MrDemeanour <mrdemeanour@xxxxxxxxxxxxxx>
Date: Fri, 07 Jul 2006 17:17:00 +0100
I have a multi-stage XSLT transformation that must take as one or more
of its inputs some external content that contains <script> elements, and
may not be well-formed.

External content of this kind is therefore wrapped by the transformer in
a <cdata> element, and successive stages in the pipleline copy that
element to their output unchanged, because they have a
  cdata-section-elements = "cdata"
attribute in their output declaration. That all works fine.

The output of the pipeline is to be serialized as HTML, and the embedded
script must eventually be output as unencoded character data. So the
final stage of the XSL contains this template:

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

That works, and the output is as expected. However the XSL 2.0 spec
states that the disable-output-escaping attribute is deprecated.

Is this deprecation an indication that the attribute should not be used,
or is it only there because output escaping can only ever work if the
output of the processor is serialized? Is there some other way of
achieving the same effect? If there is no other way of doing this, isn't
deprecation too extreme?

--
Jack.

Current Thread