John Halleck wrote:
> On Wed, 7 Mar 2001, Ralph Hartley wrote:
>
>> [...]
>
>>> On the other hand, element order must be preserved (from XML spec,
>>> attributes maybe). If the 'from' and 'to' were removed you would
>>> basically have the two line format.
>>> <survey>
>>> <station name="A1" ID="STA00001"/> <!-- added letters to make a legal ID (RLH) --!>
>>> <shot>
>>> <azi value="33.3"/>
>>> <distance value="10.2"/>
>>> <inclination value="-3.3"/>
>>> </shot>
>>> <station name="A2" ID="STA00002"/>
>>> </survey>
>>
>> I don't like this, but I don't know that it violates any of my
>> principles. The XML spec says nothing about the importance of ordering
>> between elements of the same type.
>
> Excuse me?
>
> Any XML tool that shuffled the order of elements would distroy
> documents. Paragraph elements can't be reordered, as an example.
> It is not hard to come up with other examples.
This is true. But what I said about the XML spec is true too. In fact it
does not appear discuss the MEANING, or possible transformations, of a
document at all (Please do correct me if either of these statements is
wrong, I could have missed something).
Of course many actual document types do depend on the ordering for their
correct interpretation, so it must be safe to assume that general XML
tools will preserve it.
>
>> We could define it to be significant,
>> ... I would prefer to define CaveXML so that the order is NOT
>> considered meaningful, only the nesting structure is.
>
> Well, that wrecks any documentation I put in.
Let me amend that to "The order of SOME elements is not significant".
Any documentation that was nested within elements that were reordered
would, of course, be dragged along.
Remember that some programs require shots in a PARTICULAR order, and
they may not all accept the same order. A CaveXML->other->CaveXML round
trip, done in the simplest way, would not be expected to preserve the
order of the shots. If there were no reordering freedom at all, the
round trip would be considered to make a significant change.
Be that as it may, I think I could accept enough significance in the
ordering of stations and shots for the above fragment to have the
obvious interpretation.
If we did allow that (and I haven't thought it through yet), we could
even use:
<shot>
<Azimuth value="53.3"/>
...
</shot>
<station name="A1" ID="STA00001"/>
<LRUD left="5" right="2" up="1" down="0"/>
<shot>
<Azimuth value="33.3"/>
...
</shot>
<station name="A2" ID="STA00002"/>
Where the LRUD is now unambiguously defined to be taken at A1 and facing
in direction 33.3. The only thing that breaks this is that some people
use the average direction of the two shots to define left and right
(43.3 in this case).
Ralph Hartley
This archive was generated by hypermail 2b30 : Mon Apr 02 2001 - 18:00:00 CEST