PDA

View Full Version : Need advice on loading data from xml



icedown
14 Dec 2010, 9:00 PM
I'm trying to figure out the best way of building a window around the xml. it's going to have a couple tabs, plus tabs in the tabs. Here is an example of the xml I'm putting out.




<blueprint>
<blueprinttypeid>17477</blueprinttypeid>
<producttypeid>17476</producttypeid>
<techlevel>1</techlevel>
<productiontime time="6000">1 Hours 40 Minutes 0 Seconds</productiontime>
<researchproductivitytime time="120000">1 Days 9 Hours 20 Minutes 0 Seconds</researchproductivitytime>
<researchmaterialtime time="120000">1 Days 9 Hours 20 Minutes 0 Seconds</researchmaterialtime>
<researchcopytime time="120000">1 Days 9 Hours 20 Minutes 0 Seconds</researchcopytime>
<researchtechtime time="90000">1 Days 1 Hours 0 Minutes 0 Seconds</researchtechtime>
<productivitymodifier>1200</productivitymodifier>
<materialmodifier>5</materialmodifier>
<wastefactor>10</wastefactor>
<maxproductionlimit>10</maxproductionlimit>
<typename>Covetor Blueprint</typename>
<graphicid>46</graphicid><producttypename>Covetor</producttypename>
<productgraphicid>2522</productgraphicid>
<materials>
<material typeid="34" typename="Tritanium">2120040</material>
<material typeid="35" typename="Pyerite">645030</material>
<material typeid="36" typename="Mexallon">61280</material>
<material typeid="37" typename="Isogen">17842</material>
<material typeid="38" typename="Nocxium">3972</material>
<material typeid="39" typename="Zydrine">1030</material>
<material typeid="40" typename="Megacyte">270</material>
</materials>
<manufacturing>
<skill recycle="0" damage="0" typename="Industry" typeid="3380">1</skill>
</manufacturing>
<invention>
<item recycle="0" damage="1" typename="Datacore - Gallentean Starship Engineering" typeid="20410">8</item>
<item recycle="0" damage="1" typename="Datacore - Mechanical Engineering" typeid="20424">8</item>
<item recycle="0" damage="1" typename="Incognito Ship Data Interface" typeid="25855">1</item>
</invention>
</blueprint>

I'm not new to programming, but I am new to javascript. I will say it's taking me a while to wrap my head around it. What would be the best approach to getting the data from the server into the javascript to build the windows? Keep using xml, switch to JSON ( though I'm still learning how to write it correctly)? All I need is pointed in the right direction, or maybe the correct way to search for what I'm wanting to do.

The other question is am I trying to pull something off that needs a fair amount of JS experience to do. I can always fallback and write this as a stand alone program. My goal is to evolve this into an app based off the Desktop example.