[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Transforming XML Blockquotes - Mixed Content - XSL

Subject: RE: Transforming XML Blockquotes - Mixed Content - XSLT 1.0 Solution
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 20 Apr 2005 20:40:51 +0100
problem with disable output escaping
> Perhaps there is a reason I should not solve it this way that 
> I am missing:
> <xsl:template match="blockquote">
>   <xsl:text disable-output-escaping="yes">&lt;/p&gt;</xsl:text>
>   <span class="block"><xsl:apply-templates/></span>
>   <xsl:text disable-output-escaping="yes">&lt;p 
> class="cont"&gt;</xsl:text>
> </xsl:template>

Yes, there are very good reasons why you shouldn't try to solve this problem
using disable-output-escaping. It's like using a stapler when you can't find
your cuff-links - handy in an emergency, but basically the wrong tool for
the job.

There's a deep architectural reason why d-o-e is bad, and there are
practical problems (rooted in the architectural causes) if you prefer a less
theoretical rationale.

The architectural reason is that XSLT as a language is designed to transform
trees into trees. The closure of the language - it's ability to process the
output of one transformation as the input to another, and hence the
composability and reusability of stylesheet code - depends on this property.
The d-o-e feature breaks this model, because it sends out-of-band messages
from the transformation code direct to the serializer, that destroy the
principle that the result tree forms the interface between the transformer
and the serializer.

The practical consequences are that d-o-e is not supported by all XSLT
processors, and those processors that do support it don't support it in all
situations; and that stylesheets that use it can't be combined with other
stylesheets to form a processing pipeline. Hence you might achieve your
immediate goal, but only by sacrificing portability and reusability.

Michael Kay

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.