[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simple] Update to xcap package



On Sun, 2004-02-22 at 10:23, ext Jonathan Rosenberg wrote:

> and I do an xcap addition operation:
> 
> PUT http://document/foo/bar[@id="3";]
> 
> <bar id="3"/>
> 
> 
> XCAP requires that the server create this element such that a GET to the 
> same URI returns the same body. However, there are three ways that the 
> server could do such an insertion and still meet that definition:
> 
> <foo>
>    <bar id="3"/>
>    <bar id="1"/>
>    <bar id="2"/>
> </foo>
> 
> OR
> 
> <foo>
>    <bar id="1"/>
>    <bar id="3"/>
>    <bar id="2"/>
> </foo>
> 
> OR
> 
> <foo>
>    <bar id="1"/>
>    <bar id="2"/>
>    <bar id="3"/>
> </foo>
> 
> 
> The current xcap-package includes a hash in the notify, to allow the 
> client to match what they did against what the server has. I believe 
> that, in this hash, ordering of elements and attributes is signficiant. 
> As a result, the hash computed by the server might not match the one 
> computed by the client, since both client and server did the insert 
> separately.
> 
> A different "diff" format can be defined which is more precise about 
> where the server did the insertion. For any element, specifying its 
> parent and previous sibling is sufficient. If we want the hash to remain 
> in the notifications, we'd need to define a format like that.
> 
> Hope this clarifies.
> 
> -Jonathan R.
> 
IMO you could simply define in the base spec that when appending
node(sets) or attributes with conditions like this, the insertion will
take place to the end of siblings. This would then behave similarly when
adding by using index-numbers (bar[3]) unless you want to enable "real"
inserts like in XUpdate http://www.xmldb.org/xupdate/. Btw. the
xml-libraries that I am aware of, behave like this anyway.

If ordered inserts are really required (which I doubt, at least
currently there seem to be no AU cases for that) one possibility could
be that you'll give additionally also the index for insertion like

PUT http://document/foo/bar[@id="3"][2]

BR,
Jari


_______________________________________________
Simple mailing list
Simple@ietf.org
https://www1.ietf.org/mailman/listinfo/simple