This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4315 - [XSLT] Whitespace stripping for attributes of type character
Summary: [XSLT] Whitespace stripping for attributes of type character
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords: erratum
Depends on:
Blocks:
 
Reported: 2007-02-09 19:43 UTC by Henry Zongaro
Modified: 2007-04-17 14:14 UTC (History)
0 users

See Also:


Attachments

Description Henry Zongaro 2007-02-09 19:43:25 UTC
The third item in the first bulleted list of section 2.2 of the XSLT 2.0 Recommendation states, "In all cases where this specification states that the value of an attribute must be one of a limited set of values, leading and trailing whitespace in the attribute value is ignored."

It's not entirely clear what the phrase "limited set" was intended to mean.  Does it mean "finite set" or does it mean something like "a proper subset of the possible values an attribute might have?"  I am guessing that it was intended to mean the latter, and a clarification might be in order.

With either definition though attributes whose values are specified to be a char are problematic.  If the value specified in an input document is a single whitespace character, the rule I've quoted above requires leading and trailing whitespace to be ignored, which would result in a zero-length string.

I would suggest something like the following rewording:  "In all cases where this specification states that the value of an attribute MUST be anything other than <em>string</em> or <em>char</em>, leading and trailing whitespace in the attribute value is ignored."
Comment 1 Henry Zongaro 2007-02-09 19:45:42 UTC
Sorry.  I forgot the XSLT prefix on the summary.
Comment 2 Michael Kay 2007-02-09 19:54:04 UTC
I agree this phrase is a little fuzzy. At one time I think it was intended to mean an enumerated set of values. It might be that we can define it by reference to the datatypes of the values, or to the pseudo-datatypes used in element proformas.
Comment 3 Michael Kay 2007-03-16 11:56:33 UTC
The WG reviewed the comment and agreed it was desirable to firm up the wording.

I have reviewed all the element proformas, and I agree with the commenter that the only cases where we should keep leading and trailing whitespace are those where the stated type is string or char. Henry's proposed wording for this looks fine.

There's one possible case where the old rule would (perhaps) trim whitespace and the new rule doesn't: the flags attribute of xsl:analyze-string. For simplicity I propose that we don't treat this specially. This means whitespace will not be allowed in this attribute, which is consistent with the rules for the $flags argument of functions such as matches().
Comment 4 Michael Kay 2007-04-03 22:43:40 UTC
On 22/3/2007 I took an action to propose text for an erratum.

Proposed erratum:

In the third item in the first bulleted list of section 2.2, change "In all cases where the syntax summary states that the value of an attribute must be one of a limited set of values, leading and trailing whitespace in the attribute value is ignored." to "Except where the set of allowed values of an attribute is specified using the italicized name <i>string</i> or <i>char</i>, leading and trailing whitespace in the attribute value is ignored."
Comment 5 Sharon Adler 2007-04-17 14:13:50 UTC
The WG met on 17 April 2007 at the F2F at Red Hat and reviewed and accepted M. Kay's proposal.

This completes erratum @2.