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

Re: Result still indented despite indent="no"

Subject: Re: Result still indented despite indent="no"
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 21 Feb 2005 06:51:05 +1100
still persistent sentence
On Sun, 20 Feb 2005 20:08:36 +1100, Dimitre Novatchev
<dnovatchev@xxxxxxxxx> wrote:
> On Sat, 19 Feb 2005 23:59:30 -0800 (PST), Mukul Gandhi
> <mukul_gandhi@xxxxxxxxx> wrote:
> > Hello Dimitre,
> >  The sentence you are refering ("Initially , the set
> > of whitespace-preserving element names contains all
> > element names"), is part of algorithm description by
> > the XSLT 1.0 spec, to implement xsl:strip-space and
> > xsl:preserve-space instructions..
> 
> Once again you demonstrate wrong understanding.
> 
> Let other people explain this...


Good morning,

Wow... I see that more than 10 hours and 14 new messages later Mukul
has still a persistent problem in understanding the XSLT 1.0
specification on white-space stripping.

Mukul, by now the problem in your thinking should be obvious. Do you
see it yourself? If not, here it is:

To arrive at the wrong conclusions, you are using the following
excerpt from the spec, let's label it

"A":

"After the tree for a source document or stylesheet
document has been constructed, but before it is
otherwise processed by XSLT, some text nodes are
stripped.

A text node is preserved if any of the following
apply:

1) The element name of the parent of the text node is
in the set of whitespace-preserving element names.

2) The text node contains at least one non-whitespace
character. As in XML, a whitespace character is #x20,
#x9, #xD or #xA.

3) An ancestor element of the text node has an
xml:space attribute with a value of preserve, and no
closer ancestor element has xml:space with a value of
default.

Otherwise, the text node is stripped. "


The *obvious* problem is that you have omitted part of the text.

You omitted this very important sentence, which precedes the excerpt
lets label it

"B":

"The stripping process takes as input a set of element names for which
whitespace must be preserved."

The other big problem you demonstrate is a consistent failure to see
that the  excerpt "A" you quote *only by itself* cannot be used to
determine if a given white-space-only node should be stripped or not.

The reason is that this text refers to a  "set of
whitespace-preserving element names" -- the set of names of elements,
for  which whitespace should be preserved. This set is undefined in
the excerpt quoted by you.

Therefore this excerpt is incomplete and it is wrong to make any
conclusions (including the one you make) only on this excerpt.

This is why it is necessary to resolve the incompleteness. The spec
does this by providing exactly the missing part. This is done in the
following sentence a few lines below, let's label it

"C":

"Initially , the set of whitespace-preserving element names contains
all element names"

Now, having "A" + "B" + "C"  there's a complete description of the
actions to be taken to determine whether a given whitespace-only node
is to be stripped or not.

Based on this complete description from the XSLT 1.0 specification
everyone can conclude that in the example given by you the results
obtained by Saxon and Xalan are correct.

The only way to arrive at your (opposite) conclusion is to ignore the
sentence "C" and to assume that:
    initially , the set of whitespace-preserving element names is empty.

But this assumption is exactly the opposite of what "C" is saying.

Therefore, you arrived at the wrong conclusion by ignoring part of the
specification and by making an assumption, which is contrary to the
specification.


I hope that we can agree to stop further discussing the flaws in your
logic as these flaws should now be clear to you.

Cheers,
Dimitre.

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.