[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: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 20 Feb 2005 23:04:21 -0000
xsl indent no
> The erratum says..
> "For source documents, the set of
> whitespace-preserving element names is specified by
> xsl:strip-space and xsl:preserve-space top-level
> elements".

And the sentence after that says:

Whether an element name is included in the set of whitespace-preserving
names is determined by the best match amongst xsl:strip-space or
xsl:preserve-space elements: it is included if and only if there is no match
or the best match is an xsl:preserve-space element

That makes it pretty clear, I think, that if there is no xsl:strip-space or
xsl:preserve-space declaration matching a particular element name, then the
element is included in the list of element names that preserve whitespace.

Michael Kay
http://www.saxonica.com/



>
> And the section "3.4 Whitespace Stripping" of the spec
> says..
> "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".
>
> It seems quite clear, that point 1) above defines
> behaviour when xsl:strip-space and xsl:preserve-space
> elements *are present*. In the absence of
> xsl:strip-space and xsl:preserve-space, only rules 2)
> and 3) will apply.
>
> Since rule 3) is not holding true for example XML -
> <pre>
>  <b>bold</b>
>  <i>italic</i>
> </pre>
>
> Which text nodes will be preserved will be determined
> only by rule 2). So the "white space only text nodes"
> should be stripped.
>
> Please pardon me, because my opinion is different from
> yours.
>
> Regards,
> Mukul
>
> --- Michael Kay <mike@xxxxxxxxxxxx> wrote:
>
> > > Hello Mr. Kay,
> > >   Please pardon me, because my opinion is
> > different
> > > from yours. You have refered an Erratum section
> > (E30).
> > > Its not provided in the spec
> > > URL(http://www.w3.org/TR/xslt). I cannot find it.
> > Can
> > > you please provide the URL?
> >
> > Every W3C specification provides a link to the
> > errata in the introduction to
> > the spec: see the "Status of this Document" section.
> > For XSLT 1.0 it's at
> > http://www.w3.org/1999/11/REC-xslt-19991116-errata/
> >
> > As I said, you only really need the erratum to
> > understand the rules in cases
> > when both strip-space and preserve-space are
> > present. In simple cases you
> > get the same result from the original text:
> >
> > For source documents, the set of
> > whitespace-preserving element names is
> > specified by xsl:strip-space and xsl:preserve-space
> > top-level elements.
> > These elements each have an elements attribute whose
> > value is a
> > whitespace-separated list of NameTests. Initially,
> > the set of
> > whitespace-preserving element names contains all
> > element names. If an
> > element name matches a NameTest in an
> > xsl:strip-space element, then it is
> > removed from the set of whitespace-preserving
> > element names. If an element
> > name matches a NameTest in an xsl:preserve-space
> > element, then it is added
> > to the set of whitespace-preserving element names.
> >
> > >
> > > You are saying, for the example XML -
> > > <pre>
> > >  <b>bold</b>
> > >  <i>italic</i>
> > > </pre>
> > >
> > > The first condition is true (i.e. The element name
> > of
> > > the parent of the text node is in the set of
> > > *whitespace-preserving element names*).
> > >
> > > Whereas, whitespace-preserving element names *is
> > > specified by* xsl:strip-space and
> > xsl:preserve-space
> > > elements (given in Erratum E30).
> > >
> > > Is'nt my understanding therefore right?
> >
> > I don't know what your understanding is, but in the
> > absence of
> > xsl:strip-space, all these elements are
> > whitespace-preserving and the <pre>
> > element therefore has 5 children.
> >
> > Michael Kay
> > http://www.saxonica.com/
>
>
>
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page  Try My Yahoo!
> http://my.yahoo.com

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.