This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
XQuery has adopted a proposal to allow empty enclosed expressions, e.g. <a b="some { (:absent:) } content"/> Should we do the same? We don't define value templates using a grammar, so the change required would be in 5.6: Change: A variable part consists of an XPath expression enclosed in curly brackets ({}). to A variable part consists of an optional XPath expression enclosed in curly brackets ({}). Change: It is a static error if the string contained between matching curly brackets in a value template does not match the XPath production ExprXP30 to It is a static error if the string contained between matching curly brackets in a value template does not match the XPath production ExprXP30? (that is, an expression or nothing) Change: The expansion of a variable part is obtained by evaluating the enclosed XPath expression and converting the resulting value to a string to The expansion of a variable part is obtained as follows: * If the variable part contains an expression, [current text] * Otherwise, the result is a zero-length string.
I assume you mean to allow this for dynamic AVT's, static AVT's and TVT's? I think it is a good thing. If I want to temporarily disable an expression, I have to wrap it now into smiley comments and add a "()" (empty sequence) expression to it, which is annoying (but by no means unsurpassable).
> It is a static error if the string contained between matching curly brackets > in a value template does not match the XPath production ExprXP30? (that is, > an expression or nothing) We may need to be explicit about whitespace; "nothing" is too broad (or narrow). For XPath whitespace is clearly defined, but we now say "optional XPath expression", so we must be clear about what it is when it is not an XPath expression.
The changes were accepted, and have been applied to the spec (in a way that answers the questions raised in comments on this bug). The bug remains open to allow the WG to review and approve the changes.
The change was approved.