[Nml-wg] xml list examples
Aaron Brown
aaron at internet2.edu
Thu Dec 2 15:16:01 CST 2010
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>
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