RE: wording in 20.2 (DOE)

Text that justifies why a facility is present in the spec, or that suggests
ways of using it, is by its nature incomplete, and one way we could respond
to comments like this is to take out the existing explanatory text. However,
the disable-output-escaping facility is so widely misused that I am
reluctant to do this. I am also reluctant to suggest further special effects
that can be achieved using d-o-e, since we really don't want to encourage
its use; and I think your use case would require a rather lengthy
explanation. But I'll see if I can add some words that suggest that the
examples we have given don't cover all cases.

Michael Kay

> -----Original Message-----
> From: Tobias Reif [mailto:tobiasreif@pinkjuice.com] 
> Sent: 05 May 2003 12:03
> To: public-qt-comments@w3.org
> Subject: wording in 20.2 (DOE)
> 
> 
> 
> Hi
> 
> http://www.w3.org/TR/2003/WD-xslt20-20030502/Overview-diff.htm
> l#disable-output-escaping
> 
> "20.2 Disabling Output Escaping
> 
> Normally, when using the XML, HTML, or XHTML output method, the 
> serializer will escape special characters such as & and < when 
> outputting text and attribute nodes. This ensures that the output is 
> well-formed. However, it is sometimes convenient to be able 
> to produce 
> output that is almost, but not quite well-formed XML; for 
> example, the 
> output may include ill-formed sections which are intended to be 
> transformed into well-formed XML by a subsequent 
> non-XML-aware process. 
> For this reason, XSLT defines a mechanism for disabling 
> output escaping."
> 
> But generating mal-formed XML is not the only reason for 
> having to rely 
> on shaky d-o-e.
> 
> Until I can use s.th. like
> 
> <programlisting>
>   <xsl:serialize format="xml_snippet">
>    <xsl:copy-of select="$snippet"/>
>   </xsl:serialize>
> </programlisting>
> 
> (see 
> http://lists.w3.org/Archives/Public/public-qt-comments/2003Apr
> /thread.html#54 
> )
> 
> I use
> 
>    <xsl:text
>      disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
>    <xsl:copy-of select="$forrest"/>
>    <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
> 
> [1]
> 
> This satisfies a requirement of an IMHO not-too-esoteric 
> usage scenario, 
> and the results are well-formed. 
> (http://www.w3.org/TR/REC-xml.html#NT-CDEnd must be escaped)
> 
> As long as d-o-e is one workaround for features that are not 
> available 
> in XSLT, I'm not sure if the wording is appropriate.
> 
> Perhaps adding xsl:serialize is all that's needed. 
> Personally, I don't 
> think I have a use case for d-o-e except that one: I could 
> work around 
> the missing xsl:serialize functionality without d-o-e, but it's one 
> example where d-o-e is used without generating mal-formed 
> XML. I'd be happy about not having to rely on d-o-e.
> 
> Tobi
> 
> [1] full (actual and working, but inclomplete) listing:
> 
> <xsl:template name="serialize">
>    <xsl:param name="forrest"/>
>    <xsl:choose>
>      <xsl:when test="function-available('saxon:serialize')">
>        <xsl:variable name="forrest_stripped">
>          <xsl:apply-templates select="$forrest"
>            mode="strip_ws_only_nodes"/>
>        </xsl:variable>
>        <xsl:copy-of
>          select="saxon:serialize(
>            $forrest_stripped,
>            'xml_snippets'
>          )"/>
>      </xsl:when>
>      <xsl:otherwise>
> <!-- no indenting etc -->
>    <xsl:text
>      disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
>    <xsl:copy-of select="$forrest"/>
>    <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
>      </xsl:otherwise>
>    </xsl:choose>
> </xsl:template>
> 
> 
> -- 
> http://www.pinkjuice.com/
> 

Received on Monday, 5 May 2003 16:33:25 UTC