Re: XSL (process-children-trim)

Subject: Re: XSL (process-children-trim)
From: ht@xxxxxxxxxxxxxxx (Henry S. Thompson)
Date: 13 Jan 1998 21:01:22 +0000
The 'problem' is not a problem, it's a feature.  That is, you've been
bit by the dreaded whitespace phenomenon.  It will only get worse.
Note first of all that Jade is an SGML tool, which works with XML
because all XML is valid SGML.  But it operates by normal SGML rules,
which is why you haven't noticed the problem until now.  Put (over-)simply,
SGML says that the first and last newlines in ALL elements are
ignored, and that ALL whitespace in element-only content is ignored.
What happened with your nested lists examples was that for the first
time you hit a case where whitespace was NOT ignored per the above
rules.

The clearest way to see this is to look at the output of nsgmls on
your source document.  The '\n's that you see are all and only the
ones that SGML believes are real, and that JADE will accordingly try
to render.

Now conforming XML parsers (which SP does NOT claim to be) are
required to pass ALL text content (including all that whitespace) to
applications, which may then chose to ignore some of it.  XSL as
proposed in 'A Proposal for XSL' has not addressed this issue AT ALL.

So what you get now is unlikely to be what you will get in due
course.  Note inter alia that MSXSL and XSLJ already differ in the
fine print of how they handle whitespace in mixed content.

So maybe XSL will need process-children-trim, and maybe it won't :-)

In the mean time, in XSLJ use 

<eval>process-children-trim()</eval>

instead of <children/>,

but only where you really need to.

Hope this helps,

ht
-- 
Henry S. Thompson, Human Communication Research Centre, University of Edinburgh
      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
               Fax: (44) 131 650-4587, e-mail: ht@xxxxxxxxxxxxxxx  
                      URL: http://www.cogsci.ed.ac.uk/~ht/


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • XSL (process-children-trim)
    • Glenn R. Kronschnabl - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA17920Tue, 13 Jan 1998 13:22:15 -0500 (EST)
      • Henry S. Thompson - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA18906Tue, 13 Jan 1998 16:02:13 -0500 (EST) <=