3661Re: [soapbuilders] array support
- Jun 5, 2001|> Are you referring to position having to be on every element? If so,
|> the second sentence of 220.127.116.11 Sparse Arrays says:
|I'll see that and raise you serialization rule #8 in Section 5.1 :)
That's a big rule. :-) I see two sentences that apply directly to this
"[...] with members appearing in ascending ordinal sequence."
Oops, I obviously forgot about this. Forget all I said about array elements
not having to appear in a particular order. :-)
"Likewise, an array member MAY contain a "SOAP-ENC:position" attribute
indicating the position of that item in the enclosind array."
I see this paragraph as enumerating the specific attributes that apply to
arrays (offset) and array elements (position), so saying position MAY
appear doesn't change my argument that they MUST appear on elements of a
As an aside, the arrayPoint definition is wrong, as it doesn't allow
multi-dimensional positions, which are used in the two sparse array
examples, and multi-dimensional offsets, which aren't used in an example
that I can see, but must be allowed, as offset is just a starting position.
|> I took the "Each element" to mean that every element had to have a
|I think you have to include the context, which means "each element of a
Yes, however sparse arrays are defined by having elements with positions,
so if one element has a position, it's in a sparse array, so all other
elements in that array must have a position as well.
|It is hard to imagine an implementation that is serializing arrays that
|would need the freedom of outputting them in arbitrary order.
In python and perl, sparse arrays can be represented by dictionaries and
hashes respectively (using None and undef as representations of nil
elements), so a first attempt at outputting such an array would use keys(),
which returns the keys in a random order, so the elements in the SOAP would
be in a random order.
|And it makes it harder for implementations to be able to READ the data and
|detect errors (such as overlapped entries).
It obviously depends upon what implementation language you're using, in
python and perl it fits nicely with the implementation described above,
but in other languages it might be more difficult. Of course it doesn't
really matter, being the spec does call out elements as appearing in
increasing order. However, you still have to check that.
- << Previous post in topic Next post in topic >>