[Nml-wg] xml list examples

Jason Zurawski zurawski at internet2.edu
Thu Dec 2 17:11:27 CST 2010


Guilherme;

On 12/2/10 5:58 PM, Guilherme Fernandes wrote:
> Hi,
>
> On Thu, Dec 2, 2010 at 4:31 PM, Jason Zurawski <zurawski at internet2.edu
> <mailto:zurawski at internet2.edu>> wrote:
>
>     Hi All;
>
>     On 12/2/10 4:16 PM, Aaron Brown wrote:
>      > On the call, I was asked to send some examples of how we've done
>     ordered lists in XML before. Looking through various xml bits, I
>     found a few different ways that we've sorted lists.
>      >
>      > 1) a numerical 'id' element:
>      >
>      > <nmwg-cp:hop id=”0”>
>      >               ....
>      > </nmwg-cp:hop>
>      > <nmwg-cp:hop id=”1”>
>      >               ....
>      > </nmwg-cp:hop>
>      > <nmwg-cp:hop id=”2”>
>      >               ....
>      > </nmwg-cp:hop>
>      > <nmwg-cp:hop id=”3”>
>      >               ....
>      > </nmwg-cp:hop>
>      >
>      > 2) explicit 'next' pointers:
>      >
>      > <path>
>      > <hop id="internet2-1">
>      >                ....
>      > <nextHop>esnet-1</nextHop>
>      > </hop>
>      > <hop id="esnet-1">
>      >                ....
>      > <nextHop>bnl-1</nextHop>
>      > </hop>
>      > <hop id="bnl-1">
>      >                ....
>      > </hop>
>      > </path>
>
>
>     As discussed on the call one would need to have a parser that respected
>     'document order' to ensure the next sequence is correct.  Modern XML
>     parsers feature this (e.g. LibXML), but its not a part of the XML
>     standard itself so there is no guarantee you will find it in all
>     implementations.
>
>
> If an attribute/element 'firstHop' is added to the <path> element above,
> respecting document order is no longer required:
>
> <path firstHop="internet2-1">
> <hop id="internet2-1">
>               ....
> <nextHop>esnet-1</nextHop>
> </hop>
>       ....
> </path>


You are correct about needing something to denote the head, but I was 
originally referring to example #3's sequence of values, not #2.

'Document order' (http://www.w3.org/TR/xpath/#dt-document-order) is not 
something we want to rely on in the first place since availability will 
vary by library.  There needs to be an unambiguous way to determine order.

Freek/Jerone: what does RDF do (or would could RDF do) to do the same thing?

-jason


> Best,
> Guilherme
>
>     Thanks;
>
>     -jason
>
>
>      > 3) implicit document ordering (this data corresponds to a
>     traceroute. there would be more 'datum' elements in a real
>     traceroute instance each of which corresponds to a single traceroute
>     probe sent. This was cleaned up to make it easier to read):
>      >
>      > <nmwg:data id="data.AAAFFF.0" metadataIdRef="meta.AAAFFF"
>     xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
>      > <traceroute:datum hop="198.129.254.29" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="1" value="0.135"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.219.10" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="2" value="1.14"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.217.2" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="3" value="37.212"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.209.98" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="4" value="1.616"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.220.49" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="5" value="28.643"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.209.46" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="6" value="41.773"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.221.58" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="7" value="52.36"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="134.55.218.101" numBytes="64" queryNum="1"
>     timeType="unix" timeValue="1282079154" ttl="8" value="52.373"
>     valueUnits="ms"/>
>      > <traceroute:datum hop="198.124.252.141" numBytes="64"
>     queryNum="1" timeType="unix" timeValue="1282079154" ttl="9"
>     value="52.311" valueUnits="ms"/>
>      > </nmwg:data>
>      >
>      > Cheers,
>      > Aaron


More information about the nml-wg mailing list