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.
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: