W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2003

RE: [xslt2] pretty-printed output: preserving whitespace inside c ertain elements

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Sun, 2 Mar 2003 00:36:55 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E621060453E0FB@daemsg02.software-ag.de>
To: Tobias Reif <tobiasreif@pinkjuice.com>, public-qt-comments@w3.org

I think we will need to see a fairly convincing use case before accepting
this requirement (you only say you need it, you don't say why).

The rules for indenting HTML output rely on a very detailed knowledge of the
semantics of the HTML vocabulary. You are effectively saying that other
vocabularies may also have semantics defining where whitespace is
significant, and you want equivalent facilities for such vocabularies. But
the facility you are asking for is far too crude to represent the HTML
rules.

The general rule is, if whitespace is significant, don't use indent="yes".

Michael Kay

P.S. I would also add that as a matter of procedure, we are currently
designing the XSLT 2.0 language to meet the published requirements for XSLT
2.0. Although there was no formal deadline for submitting comments on the
published requirements, we are not currently revising the requirements, and
in the interests of getting finished, as well as sticking to our charter, we
are trying to resist the temptation to add features that are not covered by
the requirements.


> -----Original Message-----
> From: Tobias Reif [mailto:tobiasreif@pinkjuice.com] 
> Sent: 28 February 2003 10:56
> To: public-qt-comments@w3.org
> Subject: [xslt2] pretty-printed output: preserving whitespace 
> inside certain elements
> 
> 
> 
> Hi
> 
> I need a way to specify a list of result tree elements whose content 
> must not be pretty-printed (indented), so that their complete 
> contents 
> (their whitespace and that of all their descendants) is preserved.
> 
http://lists.w3.org/Archives/Public/public-qt-comments/2003Feb/0023.html
for example proposes for the HTML output method:

   "(c) whitespace must not be added inside a formatted element, the
   formatted elements being pre, script, style, and textarea"

This reinforces my requirement to have whitespace preserved for a set of 
elements.

Now when I generate output other than (X)HTML, for example via 
indent="yes" and method="xml", then I need a way to specify this list.

This could look something like this:
   <xsl:output preserve="mypre myscript"
or
   <xsl:output preserve="*[@ws='pre']"
(the name of the attr is not important here; it could be dont-indent="", 
preserve-ws="", or etc)

When output method html or xhtml is set, this attribute would override 
the default list described in the above post.

Tobi

P.S.
In XSLT1, this is not easily achieved; it would be a welcome addition to 
XSLT2.
(xml:space="preserve" on result elements will be outup, which is not 
desired in most cases. Putting it on an xsl: ancestor can lead to 
trouble as well, for example before an indented xsl:attribute element.)
Perhaps I'm missing some existing XSLT2 feature.

-- 
http://www.pinkjuice.com/
Received on Saturday, 1 March 2003 18:37:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:24 GMT