• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.
  • We, the systems administration staff, apologize for this unexpected outage of the boards. We have resolved the root cause of the problem and there should be no further disruptions.

XML Format: Sector Listing

robject

SOC-14 10K
Admin Award
Marquis
My Goal. Minimally intrusive organization of existing data.

Standard Markup. I need a standard markup language, because I don't want to have to write a custom parser at the file level, and I don't want to force anyone else to write a custom parser at the file level. Writing software is enough work as it is. No reason to bog us down at square one.

XML Format. I don't like XML, but it's universal, and I find I can stand it if it is only lightly used. Which is all I want anyway. Any programming language I use which can parse YAML or JSON can also parse XML just as easily; therefore, I am happy to read and write in all three formats to suit the needs of others.

Light Touch. I've found that a non-intensive, light-touch of XML markup improves sector listings with very little overhead. They're still human-readable, with the bonus of being machine-readable.

The trick is keeping the UWP list as a block of text, rather than pre-parsed data.

Yes, the coder will still have to parse that UWP block. But the initial splitting of the file and parsing its meta-data is done for you. Parsing a block of UWPs is largely a solved problem, and we can blog about how it can be done in generic and specific ways.

Example. I am only including the first few UWPs in the example.

Code:
<Sector>
<X>-3</X>
<Y>-1</Y>
<Name>Deneb</Name>
<meta
    Alt="Sector iH"
    Coord="iH"
    DOS="deneb"
    Milieu="Second Survey"
    Ref="10080 Ring/Ray 62864"
   />

<Subsectors>
<Subsector Index="A">Pretoria</Subsector>
<Subsector Index="B">Lamas</Subsector>
<Subsector Index="C">Antra</Subsector>
<Subsector Index="D">Million</Subsector>
<Subsector Index="E">Sabine</Subsector>
<Subsector Index="F">Inar</Subsector>
<Subsector Index="G">Dunmag</Subsector>
<Subsector Index="H">Atsah</Subsector>
<Subsector Index="I">Star Lane</Subsector>
<Subsector Index="J">Vincennes</Subsector>
<Subsector Index="K">Usani</Subsector>
<Subsector Index="L">Geniishir</Subsector>
<Subsector Index="M">Gulf</Subsector>
<Subsector Index="N">Zeng</Subsector>
<Subsector Index="O">Kamlar</Subsector>
<Subsector Index="P">Vast Heavens</Subsector>
</Subsectors>

<Notes />

<Borders>...see Travellermap's API for border formatting</Borders>
<Labels>......see Travellermap's API for label formatting</Labels>
<Routes>...see Travellermap's API for route formatting</Routes>
<Allegiances>...see Travellermap's API for allegiance formatting</Allegiances>

<Data>
Pack            0102 C680879-5    De Ri                   811 Im G V +M V
Ximenes         0105 B430413-8    De Ni Po                314 Im M V 
Bolivar         0106 D354530-3    Ag Ni                   400 Im K V 
Ranim           0108 C899587-6    Ni                      111 Im G V K V 
Harran          0110 C452332-8    Lo Po                   202 Im G V +M V
Carbuncle       0201 A7308A7-A    De Na Po                902 Im G V 
Graff           0203 B98A7BA-9    Wa                      214 Im M V M V 
Kedin           0204 E423520-5    Ni Po                   311 Im F V K V* 
Iamir           0208 C590A94-8 S  De Hi In                302 Im F V 
Keats           0210 C959314-8    Lo                      111 Im F V G V 
Etienne         0302 B4247CA-B                            900 Im M III -M V 
Wulfe           0303 A52799A-F    Hi In                   802 Im M V M V 
Umkarguu        0305 C575744-4    Ag                      300 Im K V 
Antraillia      0306 D350410-4 S  De Ni Po                402 Im G V 
Leng            0402 C73A210-7    Lo Wa                   601 Im G V M V +M V
Imka            0405 D786688-5    Ag Ni Ri                423 Im G V K V 
Merel           0407 E650416-3    De Ni Po                204 Im K V 
Ninmah          0409 D670835-6    De                      812 Im M V 
(etc etc)
</Data>


</Sector>
 
Last edited:
Yay, another file format discussion. :)

Here's what the TravellerMap.com site uses internally:

http://travellermap.com/res/sectors/FarFrontiers.xml

Code:
<Sector>
<Subsectors>
<Subsector Index="A" Source="Travellers' Chronicles #5">Detsiaiem</Subsector>
<Subsector Index="B" Source="Travellers' Chronicles #5">Ienji</Subsector>
<Subsector Index="C" Source="Travellers' Chronicles #6">Naianch</Subsector>
<Subsector Index="D" Source="Travellers' Chronicles #6">Qiedrkia</Subsector>
<Subsector Index="E" Source="Travellers' Chronicles #6">Pia</Subsector>
<Subsector Index="F" Source="Travellers' Chronicles #8">Retan</Subsector>
<Subsector Index="G" Source="Travellers' Chronicles #8">Dalesabandagh</Subsector>
<Subsector Index="H" Source="Travellers' Chronicles #8">Zezhpae</Subsector>
<Subsector Index="I" Source="Travellers' Chronicles #2">Antideluvia</Subsector>
<Subsector Index="J" Source="Travellers' Chronicles #2">Alsas</Subsector>
<Subsector Index="K" Source="Travellers' Chronicles #3">Taemerlyk</Subsector>
<Subsector Index="L" Source="Travellers' Chronicles #3">Inverness</Subsector>
<Subsector Index="M" Source="Travellers' Chronicles #3">Wulfek</Subsector>
<Subsector Index="N" Source="Travellers' Chronicles #4">Cabala</Subsector>
<Subsector Index="O" Source="Travellers' Chronicles #4">Jungleblut</Subsector>
<Subsector Index="P" Source="Travellers' Chronicles #4">Mnemosyne</Subsector>
</Subsectors>
<Allegiances Source="The Far Frontiers Manuscript" Author="Dale Kemper">
<Allegiance Code="Az">The Alntzar Domain</Allegiance>
<Allegiance Code="Bi">The Biumvirate</Allegiance>
...
</Allegiances>
<Borders Source="The Far Frontiers Manuscript" Author="Dale Kemper">
<Border ShowLabel="false" Allegiance="Az" Color="indigo">
1736 1836 1936 2036 2037 2038 2139 2039 1939 1838 1837 1836 1736
</Border>
<Border ShowLabel="false" Allegiance="Bi" Color="yellow">1437 1538 1638 1639 1540 1439 1438 1437</Border>
<Border ShowLabel="false" Allegiance="Ca" Color="orange">
0235 0335 0334 0433 0534 0634 0734 0834 0835 0836 0837 0938 0939 0839 0840 0740 0640 0540 0440 0340 0339 0338 0237 0236 0235
</Border>
...
</Borders>
<Labels>
<Label Hex="1936" Allegiance="Az">Domain of Alntzar</Label>
<Label Hex="1540" Allegiance="Bi">Biumvirate</Label>
<Label Hex="0438" Allegiance="Ca">Colonade Administration District</Label>
...
</Labels>
<Routes Source="The Far Frontiers Manuscript" Author="Dale Kemper">
<Route Start="0123" End="0124" Type="Trade" Color="Gray"/>
<Route Start="0124" End="0125" Type="Trade" Color="Gray"/>
<Route Start="0125" End="0225" Type="Trade" Color="Gray"/>
<Route Start="0225" End="0326" Type="Trade" Color="Gray"/>
...
</Routes>
</Sector>

Notes:

  • I include rendering information - colors, labels, etc. A fundamental data interchange format should not preclude these additions.
  • I use elements for many items so they can be tagged with attribution metadata attributes (author, source, era, etc) on a per-item basis. For example, I need to note where each Subsector name comes from.
  • In this particular example the UWP data is referenced out of band; supporting either inline definition (as in robject's example) or a reference - e.g. <DataFile src="farfrontiers.sec" .../> makes sense.

We should be clear that we'd like to define a (1) interchange and (2) archival format, not a runtime format.
 
Note that if you can use the travellermap.com formats, then your outputs could be compatible with the travellermap.com APIs.
 
Yeah yeah. Also note that, being a responsible programmer, his API is quite flexible.

For example, the reference to the data file for Deneb is:

Code:
<DataFile Author="Donald McKinney" Type="T5">Deneb Draft.txt</DataFile>

Type = T5. In other words, if there's a standard he wants to implement, he can do it with a switch.
 
I have been seeing these discussions about xml.

I have even tried to grab a book or two to try to learn enough about it to follow them.

I get what a schema is, but the rest is not coming. Can anyone direct me to tutorials that might be useful. programming is all in c, pascal and basic with a smattering of assembly, but it is all very out of date.

I understand the desire for a universal format, and grok that xml is a way to achieve that, but the mechanics are beyond my grasp at this point.
 
Back
Top