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

Re: disable-output-escaping

Subject: Re: disable-output-escaping
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 04 Dec 2001 14:37:29 -0500
disable output escaping doctype
At 07:43 PM 12/3/01, Mike Brown wrote:
Wendell Piez wrote:
> It is significant that people most often try the d-o-e approach when they
> are either (1) still naive about the way XSLT works, and projecting
> mistaken expectations onto it (see Mike's (b)), or (2) trying to build an
> application whose concept or design is already threatening the markup/text
> distinction, such as handling ill-formed HTML markup wrapped in XML, or
> trying to do "metamarkup" in some way (marking up markup).

My experience with developers who are well-versed in other languages but
not in XML is that they don't see any compelling reason to maintain such a
markup/text distinction. There is really nothing wrong with wrapping HTML
in XML; this is not indicative of poor application design.

I agree with this: there's nothing wrong with it in the general case, and whether it's poor application design really depends on other factors.


But note I didn't say "wrapping HTML in XML" but "ill-formed HTML wrapped in XML". That is, there's a distinction between an application that does:

<chapter>
<h1>Chapter One</h1>
<p>It was <i>a dark and stormy night</i> and ...</p>
</chapter>

where the contents of <chapter> is well-formed (X)HTML, and

<chapter>
<![CDATA[
<h1>Chapter One</h1>
<p>It was <i>a dark and stormy night</i> and ...
]]>
</chapter>

True, in the second case we can still get the HTML in our output (if we write a file using disable-output-escaping). And sometimes this may be the only or best way to do it (i.e. wrap your HTML in CDATA and treat it as text). Most of the time, however, it should be possible to maintain the markup/text distinction by following the syntax rules (here, XML well-formedness) that make that distinction possible -- running HTMLTidy or otherwise fixing any broken HTML before we shovel it in. The advantages of doing it this way are considerable.

 The problem is
merely that they view their intended output as a pastiche of strings, and
XSLT as instructions for generating those strings, whereas they should be
viewing their output as the serialized form of what is essentially a
single XML document that was created one abstract node at a time.

This is a nice way of phrasing exactly what I mean. Markup is not text: instead, it is a notation for or representation of something extra-textual -- the structure of abstract nodes.


Anyway, this is edging into not being an XSL topic anymore (though you should still feel free to criticize on- or off-list :-).

Cheers,
Wendell

> A third case such as Rick Geimer's writing the internal declaration subset
> is the exception that proves the rule. Here, we'd like to write the output
> as markup, but since XSLT doesn't give us facilities to manage and output
> declarations as markup (strictly the DOCTYPE declaration with its contents
> ought to be markup), one has no choice but to fall back on pretending it's
> text.

I prefer to look at this as a matter of XSLT 1.0 was simply not designed
to output a document type declaration with an internal subset -- just as
it was not designed to output references to entities, entities that are
likely to be the only things declared in the internal subset. So in my
opinion, there is no greater justification for using
disable-output-escaping to write a <!DOCTYPE> with an internal subset than
there is for using it to write an entity reference. It's still a hack.

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.