Nothing Special   »   [go: up one dir, main page]

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 11014 - Boolean literals?
Summary: Boolean literals?
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-12 14:46 UTC by Jonathan Robie
Modified: 2010-12-03 20:25 UTC (History)
3 users (show)

See Also:


Attachments

Description Jonathan Robie 2010-10-12 14:46:53 UTC
The following text in "3.1.1 Literals" implies, but does not state, that fn:true() and fn:false() can be used to represent Boolean literals:

"The xs:boolean values true and false can be represented by calls to the built-in functions fn:true() and fn:false(), respectively."

This comes immediately after a list of examples of literals, and immediately before this text:

"Values of other atomic types can be constructed by calling the constructor function for the given type."

Do we intend to allow these to be used as literals? The grammar does not support them. We need to clarify this text one way or another.
Comment 1 Michael Kay 2010-10-12 14:59:38 UTC
The function calls true() and false() are not literals, but they fulfil the same role as literals, in that you can use them in an expression anywhere you can use a literal. I think that's what the text is trying to say.
Comment 2 Josh Spiegel 2010-10-26 17:31:00 UTC
Related to this, in section 4.15 Annotations it states:

"An annotation always has a value. If no explicit value is provided, the value is fn:true(). "

But the grammar for an annotation is: 
[27] Annotation ::= "%" EQName ("(" Literal ("," Literal)* ")")?

So it seems that a user can not set the value of an annotation to fn:false() which is strange given the default value is fn:true()?
Comment 3 Jonathan Robie 2010-11-02 17:47:45 UTC
The Working Group decided to fix this by removing the last sentence in the following excerpt:

(In reply to comment #2)
> Related to this, in section 4.15 Annotations it states:
> 
> "An annotation always has a value. If no explicit value is provided, the value
> is fn:true(). "

Editorially, the following may be clarified:

"The xs:boolean values true and false can be represented by calls to the
built-in functions fn:true() and fn:false(), respectively."
Comment 4 John Snelson 2010-12-03 20:25:22 UTC
This has now been fixed.