W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2016

[Bug 29434] [XSLT30] xsl:on-empty/on-non-empty with attributes and use-attribute-sets

From: <bugzilla@jessica.w3.org>
Date: Tue, 09 Feb 2016 19:21:11 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29434-523-9TKTd5zaxD@http.www.w3.org/Bugs/Public/>

--- Comment #2 from Abel Braaksma <abel.braaksma@xs4all.nl> ---
That is a change, I'm not sure we intended emptiness to mean a sequence of
attributes. Since this instruction may be used in contexts where we are not
constructing an element, I'm not sure that is desirable (though I can see
benefits and downsides).

More importantly, I realize that we may not be defining this clearly enough in
terms of "Constructing complex/simple content". I think it makes sense that
xsl:on-empty kicks in *after* constructing the content leaves us with
emptiness. If we do, the next ambiguity, about a document node with empty text
node children becomes a no-brainer, as they are normalized away.

As such, I propose something along those lines instead:

When a sequence constructor contains an xsl:on-empty instruction, it is first
removed (as if by use-when="false()") and the resulting sequence constructor is
evaluated following the rules in [#REF: 5.7 Sequence Constructor]. If the
result is a zero-length text node (or a sequence of zero-length strings, but
the rules in 5.7 prevent that from happening), the sequence constructor result
is discarded and replaced by the result of evaluating the sequence constructor
or select attribute of the xsl:on-empty instruction.

That, of course, does not answer the question whether attribute nodes created
by the sequence constructor should be considered.

Example: a sequence ctor that adds lat/long as attributes

<xsl:template match="coor[lat|long]">
   <xsl:attribute name="lat" select="lat" />
   <xsl:attribute name="long" select="long" />
      <xsl:attribute name="lat" select="'#absent'" />
      <xsl:attribute name="long" select="'#absent'" />

If we change xsl:on-empty the way you suggest, the above would never trigger
the xsl:on-empty. Is that really how we want it to behave? Shouldn't that be in
the realm of xsl:where-populated?

You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 9 February 2016 19:21:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:59 UTC