The SOAP 1.1 specification is deficient in describing the interaction
between offset and position attributes. Correcting this and adding
specificity would be a good activity for the W3C XML Protocol Working Group.
I'll give you my recollection of the intention of the authors of that
section of the spec, stressing that the behavior I am about to describe is
reasonable, is consistent with the specification, but is not mandated by the
specification.
The model in mind is that an array consists of a sequence of elements, each
distinguished by position, p, which is an ordinal, as in [i]. In the case
of a multi-dimensional array, the position is a sequence of ordinals,
[i,j,k...]. Assume for any particular array a function Next(p) that takes
as input the position of an element and returns the position of the next
element in the array. There is a distinguished position First.
The decoding of an array to determine the position of each element uses the
rule that
If an element has an explicit position attribute,
that position attribute indicates the position exactly
Else position is given by
If there was a prior element in the encoding,
Next(p) applied to the position of the prior element in the
encoding,
Else
If there is an offset attribute, position is given by the value
of the offset,
Else position is First.
For practical reasons, we should consider it an error if the encoded
position of an element is the same as or prior to the position of the
previous element.
Elements that are omitted are simply not in the array, and the emptiness of
that array position is represented in memory in a language and
data-model-dependent way.
Andrew Layman
http://strongbrains.com -- Resources for Self-Education
----- Original Message -----
From: "Matt Long" <mlong@...>
To: <soapbuilders@yahoogroups.com>
Sent: Sunday, August 26, 2001 4:00 AM
Subject: RE: [soapbuilders] Re: Sparse array interoperability
Andrew,
Can an array utilize offset + position?
<myArray SOAP-ENC:arrayType="xsd:string[10]" SOAP-ENC:offset[4]>
<item position="[6]">p6</item>
<item position="[8]">p8</item>
<item>p9</item>
</myArray>
Also, MUST "position" be sequential?
-Matt
> -----Original Message-----
> From: Andrew Layman [mailto:mail@...]
> Sent: Saturday, August 25, 2001 12:42 PM
> To: soapbuilders@yahoogroups.com
> Subject: Re: [soapbuilders] Re: Sparse array interoperability
>
>
> You might also be interested in a post I recently made to
> XML-Dist-App:
> http://lists.w3.org/Archives/Public/xml-dist-app/2001Aug/0201.
> html . While
> the subject is not sparse arrays per se, it contains
> amplification on my
> assertions that nulls are not a kind of value, but rather a
> grammatical
> mechanism indicating that no value exists. (Nothing is not a kind of
> something.) Further, nils, in the xml schema sense, are not
> nulls. Nils
> are an indication that an element is schema-valid when empty.
>
> Referring specifically to your citation of
> http://groups.yahoo.com/group/soapbuilders/message/4980, and
> the example
>
> <item xsi:nil="true"/>
> <item xsi:nil="true"/>
> <item href="#id1"/>
> <item xsi:nil="true"/>
> <item href="#id2"/>
> <item xsi:nil="true"/>
>
> whatever this is, it is not a "sparse array" in the sense
> described in SOAP
> 1.1 section 5. It appears to be the content of an array
> (type unknown) most
> of the elements of which are empty or zero-length strings,
> and two elements
> of which refer to values represented elsewhere.
>
> Looking earlier in the thread I find a more elaborate example
> in message
> http://groups.yahoo.com/group/soapbuilders/message/4948 .
> This appears to me
> to be a correct sparse array, namely an array of size six
> with only two
> cells having values, those values being structs.
>
> If I understand the question the proper response would seem to be like
>
> <item href="#id1" SOAP-ENC:position="[2]"/>
> <item href="#id2" SOAP-ENC:position="[4]"/>
>
> or
>
> <item xsi:type="ns1:SOAPStruct" SOAP-ENC:position="[2]">
> <varString xsi:type="ns3:string">STRING</varString>
> <varInt xsi:type="ns3:int">1</varInt>
> <varFloat xsi:type="ns4:float">1</varFloat>
> </item>
> <item xsi:type="ns1:SOAPStruct" SOAP-ENC:position="[4]">
> <varString xsi:type="ns3:string">STRING</varString>
> <varInt xsi:type="ns3:int">2</varInt>
> <varFloat xsi:type="ns4:float">2</varFloat>
> </item
>
> Andrew Layman
> http://strongbrains.com -- Resources for Self-Education
> ----- Original Message -----
> From: <nahi@...>
> To: <soapbuilders@yahoogroups.com>
> Sent: Saturday, August 25, 2001 8:22 AM
> Subject: [soapbuilders] Re: Sparse array interoperability
>
>
> Hi Andrew,
>
> Thank you for your response. I was looking forward to hear
> someone's view.
>
> --- In soapbuilders@y..., "Andrew Layman" <mail@s...> wrote:
> > The SOAP 1.1 specification does not justify some of the assumptions
> made
> > below. In particular, the below goes wrong at step 2. Element
> omission
> > does not necessarily mean
> > "nil" (whatever "nil" means!) Element omission is simply omission,
> absence.
>
> I see. This is my first understanding.
> If element omission is simply omission and it does not mean nil,
> I should not adopt the conversion
> "contains 'nil' element" => sparse array
> in http://groups.yahoo.com/group/soapbuilders/message/4980
> How others think?
>
> I can understand both sides and change SOAP4R's behavior.
>
> Regards,
> // NaHi
>
>
>
> -----------------------------------------------------------------
> This group is a forum for builders of SOAP implementations to discuss
> implementation and interoperability issues. Please stay on-topic.
>
> To unsubscribe from this group, send an email to:
> soapbuilders-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
-----------------------------------------------------------------
This group is a forum for builders of SOAP implementations to discuss
implementation and interoperability issues. Please stay on-topic.
To unsubscribe from this group, send an email to:
soapbuilders-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
-----------------------------------------------------------------
This group is a forum for builders of SOAP implementations to discuss
implementation and interoperability issues. Please stay on-topic.
To unsubscribe from this group, send an email to:
soapbuilders-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/