<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>1451</bug_id>
          
          <creation_ts>2005-05-16 15:25:17 +0000</creation_ts>
          <short_desc>[XQuery]: Optional indicator in direct element and attribute constructors</short_desc>
          <delta_ts>2005-09-29 18:12:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 1.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://lists.w3.org/Archives/Public/public-qt-comments/2005May/0216.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>futureConsideration</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="C. M. Sperberg-McQueen">cmsmcq</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          <cc>dengovatov</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>3261</commentid>
    <comment_count>0</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2005-05-16 15:25:17 +0000</bug_when>
    <thetext>[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 
&lt;a&gt;&lt;b&gt;{()}&lt;/b&gt;&lt;c foo=&quot;{()}&quot;/&gt;&lt;/a&gt;, 

instead of returning 
&lt;a&gt;&lt;b/&gt;&lt;c foo=&quot;&quot;/&gt;&lt;/a&gt;

to return 
&lt;a&gt;&lt;c/&gt;&lt;/a&gt;

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 &quot;optional&quot; indicators, using &apos;?&apos; character
(&quot;?&quot;?) to the direct element and attribute constructors:

Change production DirElemConstructor to

[94]    DirElemConstructor    ::=    &quot;&lt;&quot; QName &quot;?&quot;? DirAttributeList
(&quot;/&gt;&quot; | (&quot;&gt;&quot; DirElemContent* &quot;&lt;/&quot; QName S? &quot;&gt;&quot;)) /* ws: explicit */ 
   

And for 
[95]    DirAttributeList    ::=    (S (QName &quot;?&quot;? S? &quot;=&quot; S?
DirAttributeValue)?)*

When &apos;?&apos; is present, elements with no children should be omitted, and
attributes with value &quot;&quot; should be omitted.

Query in the example would be written

&lt;a&gt;&lt;b?&gt;{()}&lt;/b&gt;&lt;c foo?=&quot;{()}&quot;/&gt;&lt;/a&gt;

To produce &lt;a&gt;&lt;c/&gt;&lt;/a&gt;

Daniel;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2731</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2005-06-10 17:29:37 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6613</commentid>
    <comment_count>2</comment_count>
    <who name="Daniel Engovatov">dengovatov</who>
    <bug_when>2005-09-29 18:05:10 +0000</bug_when>
    <thetext>Should not the bug be kept open against a future version of XQuery?  We would 
not want the issue to be dropped.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6614</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Cotton">pcotton</who>
    <bug_when>2005-09-29 18:12:19 +0000</bug_when>
    <thetext>The WG is tracking issues for V.Next and this item will not be dropped.

/paulc</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>