Traveller Store CotI Features New Posts Mark Forums Read Register


Go Back TravellerRPG.com > Citizens of the Imperium > General Traveller Discussions > Software Solutions

Software Solutions Discussions on Traveller related software.

Reply
 
Thread Tools Display Modes
  #1  
Old December 27th, 2011, 01:09 PM
robject robject is offline
Marquis
 
Join Date: Mar 2002
Posts: 10,653
Gallery : 9
Visit robject's Blog
robject has disabled reputation
Default XML Format: Sector Listing

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>
__________________
My Helpful Stuff for Traveller5
IMTU tc+ t5++ 3i(+) au ls+ / OTU 44% an+ dt+ ge- j- jf+ n- pi+ pp+ tr+ tv- uwp+ xb+

Last edited by robject; December 28th, 2011 at 12:55 AM..
Reply With Quote

Welcome!
To see more of this thread, please login or register.
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Survey Schema (Excel <=> XML) Ver. 1 robject Software Solutions 2 August 3rd, 2011 12:06 AM
Excel importing and exporting XML UWP data robject Software Solutions 47 April 18th, 2007 02:41 AM
Subsector Map sizes (on paper), UWP Listing Styles & Sector Maps Gruffty Imperial Interstellar Scout Service 10 January 12th, 2006 08:37 AM
Traveller XML star database tjoneslo Software Solutions 16 November 28th, 2003 04:25 PM

This website and its contents are copyright ©2010-2013 Far Future Enterprises. All rights reserved. Traveller is a registered trademark of Far Future Enterprises .
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright (c) 2010-2013, Far Future Enterprises. All Rights Reserved.