<?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>1128</bug_id>
          
          <creation_ts>2005-02-22 15:21:27 +0000</creation_ts>
          <short_desc>Accessing and modifying members of lists and arrays</short_desc>
          <delta_ts>2005-09-28 22:17:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WS Choreography</product>
          <component>Last Call Comment: Confirmed Closed</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/2004/WD-ws-cdl-10-20041217/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>--</target_milestone>
          
          <blocked>1166</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Greg Ritzinger">gritzinger</reporter>
          <assigned_to name="Steve Ross-Talbot">steve</assigned_to>
          
          
          <qa_contact name="Martin Chapman">martin.chapman</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>4070</commentid>
    <comment_count>0</comment_count>
    <who name="Greg Ritzinger">gritzinger</who>
    <bug_when>2005-02-22 15:21:28 +0000</bug_when>
    <thetext>Due to a lack of clarity in existing XML specifications, the WS-Choreography
Working Group is unable at this time to recommend an approach for accessing and
modifying members of lists and arrays.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3889</commentid>
    <comment_count>1</comment_count>
    <who name="Greg Ritzinger">gritzinger</who>
    <bug_when>2005-03-09 15:18:43 +0000</bug_when>
    <thetext>Proposal from Gary Brown:

http://lists.w3.org/Archives/Public/public-ws-chor/2005Mar/0013.html

Following on from Tony&apos;s ideas:

List/Array Access/Update issue

Date: 9th March 2005



Accessing a list or array

This can be achieved using existing XPath expression support. The CDL
&apos;getVariable&apos; function will return the value associated with a variable and
optionally a component within the XML document represented by the variable. It
would then be possible for the XPath expression to perform further evaluation on
the returned result.

Alternatively the list accessor could be placed in the XPath expression supplied
as a parameter to the &apos;getVariable&apos; function.

For example, if we have a variable called &apos;doc&apos; which contains the XML data from
Tony&apos;s previous example, then

variable &apos;doc&apos; will contain:

    &lt;listA&gt;
        &lt;listItem&gt;1&lt;/listItem&gt;
        &lt;listItem&gt;2&lt;/listItem&gt;
        &lt;listItem&gt;4&lt;/listItem&gt;
        &lt;listItem&gt;8&lt;/listItem&gt;
    &lt;/listA&gt;

If we also have a variable &apos;index&apos; that is acting as an index value, so is of
type xs:integer, then the following Xpath expression would be used to access the
list element associated with the current index value,

cdl:getVariable(&apos;doc&apos;, &apos;&apos;, &quot;/listA/listItem[cdl:getVariable(&apos;index&apos;,&apos;&apos;,&apos;&apos;,&apos;&apos;)]&quot;, &apos;&apos;)

Alternatively, we could move the list accessing expression outside the function:

cdl:getVariable(&apos;doc&apos;,&apos;&apos;)/listA/listItem[cdl:getVariable(&apos;index&apos;,&apos;&apos;,&apos;&apos;)]

This may be a better approach than embedding the XPath expression inside the
&apos;getVariable&apos; function, which avoids nested functions. It may be even better to
be able to reference CDL variables natively within the XPath expression,
although this would not cater for multi-part messages - and other
&apos;isVariableAvailable&apos; function would still be required.



Modifying a list or array

I don&apos;t think it is appropriate to add functions to XPath that modify the
document being queried, as this may have unknown consequences on the remainder
of the xpath evaluation.

My preference would be to use XPath expressions to identify the context for the
modification being performed, and then have specific activities to perform the
modification.

One possibility would be to change the current assign/copy construct, so that
copy would be a &apos;replace&apos; operator, while &apos;insert&apos;/&apos;delete&apos;/&apos;append&apos; operators
could be used for list manipulation.

For example,

&lt;update&gt; &lt;!-- instead of &apos;assign&apos; --&gt;
    &lt;copy target=&quot;cdl:getVariable(&apos;newNode&apos;)&quot; expression=&quot;
&apos;&lt;listItem&gt;16&lt;/listItem&gt;&apos; &quot; /&gt;
    &lt;append context=&quot;cdl:getVariable(&apos;doc&apos;)/listA&quot;
expression=&quot;cdl:getVariable(&apos;newNode&apos;)&quot; /&gt;
    &lt;delete expression=&quot;cdl:getVariable(&apos;doc&apos;)/listA/listItem[2]&quot; /&gt;
&lt;/update&gt;

The &apos;insert&apos; could be the same syntax as the append, with the addition of a
&apos;position&apos; attribute to indicate the insertion point.

If it is considered necessary to separate the variable from the context node
within the variable&apos;s document, then that could be easily achieved. For example,

&lt;append variable=&quot;cdl:getVariable(&apos;doc&apos;)&quot; context=&quot;/listA&quot;
expression=&quot;cdl:getVariable(&apos;newNode&apos;)&quot; /&gt;

NOTE: To support concurrent update of any information (but especially the
lists), within a choreography, we should stipulate that the &apos;update&apos; activity is
atomic and isolated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3256</commentid>
    <comment_count>2</comment_count>
    <who name="Steve Ross-Talbot">steve</who>
    <bug_when>2005-05-16 14:01:41 +0000</bug_when>
    <thetext>PROPOSAL TO CLOSE WON&apos;T FIX and add text to primer

Basis:

To properly modify information (lists/arrays/xml documents) in concurrent threads requires a level of 
isolation/synchronization, and CDL only provides a coarse mechanism for this - so would prefer to 
leave these modifications for ***silentActions***, which can then implement any 
necessary synchronization.

We should not really be adding further activities that make this a more turing complete language.

Thus silentActions can be used as a suitable silent mechanism for accessing and modifying lists and 
arrays and therefore we do not need explicit support in WS-CDL to do this. 

The primer should include an example of how this might be done using WS-CDL, silentActions and a 
suitable end point language.

-DONE BY SRT</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3258</commentid>
    <comment_count>3</comment_count>
    <who name="Steve Ross-Talbot">steve</who>
    <bug_when>2005-05-16 14:15:27 +0000</bug_when>
    <thetext>Changed QA Contact to steve from martin as steve is main author of primer and this has been 
reassigned as a primer issue</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>