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

Re: tag minimisation

Subject: Re: tag minimisation
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Tue, 10 Sep 2002 19:13:27 +0100
xsl empty div
Hi Andrew,

>> The use xsl:output method="html" and it won't happen.
>
> What if you want xml output that will subsequently be used as html,
> such as in a chain of transformations?

Then surely the process at the end of the line is responsible for how
the eventual HTML is output? In a pipeline of operations on an XML
document, I would have thought that the document received as input to
the process after the transformation you're talking about should be
processed as an information set rather than as a sequence of
characters (and if it *is* being processed as a sequence of characters
then I doubt it's XML-aware, in which case using the 'html' output
method shouldn't matter).

> Other than for visual neatness, why minimise elements?

Every choice made when serialising an XML document (whether to use "
or ' around attribute values, whether to use CDATA sections or
individual escapes, whether to use decimal or hexadecimal character
references etc. etc.) is about how it *looks* rather than what the
document *means*. The only reason you could possibly have for
preferring one serialisation over another is your own idea of "visual
neatness".

The reason you're having problems with the empty element syntax in web
browsers is because web browsers aren't XML processors and therefore
don't understand the fact that in an XML world, <div /> (or <div/>)
means *exactly* the same as <div></div>.

What I suggest you do is one of the following:

  - post process your XML with an identity transformation that turns
    all empty div elements into div elements that contain a comment.

  - use the XHTML output method, if your processor supports it

  - write your own Serialiser for the processor that you're using, and
    use that serialiser instead of the one the processor comes with.

The first is a bit of a hack, but there you go.
    
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.