<?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>7371</bug_id>
          
          <creation_ts>2009-08-19 20:30:13 +0000</creation_ts>
          <short_desc>Propose empty sequence be allowed for $content argument</short_desc>
          <delta_ts>2011-01-08 00:26:57 +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>Update Facility</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xquery-update-10/#id-upd-insert-attributes</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Justin Johansson">procode</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jim.melton</cc>
    
    <cc>mike</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>26535</commentid>
    <comment_count>0</comment_count>
    <who name="Justin Johansson">procode</who>
    <bug_when>2009-08-19 20:30:13 +0000</bug_when>
    <thetext>This is the first issue that I&apos;ve logged @ w3c bugzilla so hopefully I&apos;m observing correct protocol.

http://www.w3.org/TR/xquery-update-10/#id-upd-insert-attributes

upd:insertAttributes(
   $target as element(),
   $content as attribute()+)

There are use cases in which $content is computed and the result may be a sequence of zero attributes.  Therefore changing the function signature to the following would obviate the need to test for $content being an empty sequence prior to issuing the function call.

upd:insertAttributes(
   $target as element(),
   $content as attribute()*)

A similar argument applies to the $target argument and accordingly

upd:insertAttributes(
   $target as element()?,
   $content as attribute()*)

is arguably more flexible.

Obviously the above comments are likely to have flow on implications for other upd:* functions to observe argument-wise consistency.

Regards

Justin Johansson</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26537</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-08-19 20:42:22 +0000</bug_when>
    <thetext>I think this comment would be valid if upd:insertAttributes were designed for use in a user application. However, it&apos;s an internal function, and all the places where it is called have the general form:

&lt;quote&gt;
The pending update list consists of the following update primitives:
   1.  If $alist is not empty, upd:insertAttributes($parent, $alist)
&lt;/quote&gt;

None of the calls to the function will ever supply an empty $alist, so it doesn&apos;t make much difference whether the function signature allows one.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26538</commentid>
    <comment_count>2</comment_count>
    <who name="Justin Johansson">procode</who>
    <bug_when>2009-08-19 21:28:24 +0000</bug_when>
    <thetext>Thanks for the qualification, Mike.

Case is at the moment I happen to be writing an XQuery Update Facility - compatible/emulation layer for an existing XML database product which has XQuery-only capability but is unlikely to have XQuery Update built into it for quite some time.

So the reason I happened across the issue is that I consulted the Candidate Recommendation only a few hours ago for this very function, so as to understand the functionality required and to copy the signature for my XQuery Update emulator function of the same name (in my emulator namespace).

Then I said to myself, &quot;bugger&quot;, I have to check for empty attribute sequence before I can call this one :-)

Given that expert advice is &quot;...so it doesn&apos;t make much difference whether the function signature allows one&quot; then it would not be too much of an imposition to accommodate me?  Please.

Thanks, guys.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26539</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2009-08-19 22:00:34 +0000</bug_when>
    <thetext>The functions in the spec are for the purposes of the spec only. You can have any function you like in your implementation.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>