Using doe

Included Markup

1. Disable Output Escaping - a hack to be used with care

1.

Disable Output Escaping - a hack to be used with care

Jonathon Marsh

David Carlisle wrote:
> Any use of disable-output-encoding is _always_ a hack.

My experience has led me to this conclusion as well.  I'm
glad this feature is available, because sometimes you need
the ability to hack output.

An example of the problems disable-output-escaping allows:
MSXML can be used to generate a text stream as the result of
a transformation, as with node.transformNode(xsl), or it can
create a new XML document, as with
node.transformNodeToObject(xsl,newdoc).  In some cases,
disable-output-encoding can cause a transform that succeeds
when processed to a stream to fail when creating a new
document.  A feature that allows a legal stylesheet to fail
in certain contexts should indeed be considered as enabling
hacks rather than a core feature of the language, and should
be used with caution.

For HTML embedded as text in a database, I've found that the
cleanest architecture is to embed HTML markup in the XML
document as well-formed XML, distinguished by the xhtml
namespace if necessary.  While this means cleaning up data
early on, it significantly reduces the potential for
headaches later on.  For instance, structurally embedded
HTML can be queried structurally, have additional metadata
embedded in it, or be extended with other namespaces.  If
it's embedded as CDATA, none of these options are available.
From an XML perspective, HTML stored as text in a database
is a legacy problem due to the limitations of traditional
databases to handle the structure implied of markup -
something XML is intended to correct.