This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
[Transcribed from comments list by CMSMcQ. See also the thread beginning http://lists.w3.org/Archives/Public/public-qt-comments/2005May/0216.html] This is an enhancement proposal based upon a very frequently encountered problem among users of our implementation: an external consumer of XML generated by XQuery does want to have certain empty elements and attributes to be omitted. For example: for a query <a><b>{()}</b><c foo="{()}"/></a>, instead of returning <a><b/><c foo=""/></a> to return <a><c/></a> Producing this result using computed constructors, conditional statements and custom functions turns out to be quite inelegant, cumbersome and hard to maintain. Proposed extension is to add "optional" indicators, using '?' character ("?"?) to the direct element and attribute constructors: Change production DirElemConstructor to [94] DirElemConstructor ::= "<" QName "?"? DirAttributeList ("/>" | (">" DirElemContent* "</" QName S? ">")) /* ws: explicit */ And for [95] DirAttributeList ::= (S (QName "?"? S? "=" S? DirAttributeValue)?)* When '?' is present, elements with no children should be omitted, and attributes with value "" should be omitted. Query in the example would be written <a><b?>{()}</b><c foo?="{()}"/></a> To produce <a><c/></a> Daniel;
On May 16, the Query Working Group decided that this request was beyond the scope of XQuery Version 1. Your request for new functionality will be considered in a future version of XQuery. Please let us know whether you are satisfied with this resolution of your comment.
Should not the bug be kept open against a future version of XQuery? We would not want the issue to be dropped.
The WG is tracking issues for V.Next and this item will not be dropped. /paulc