NationStates Jolt Archive


XML nation/region data into HTML

Adejaani
03-10-2003, 05:23
Hi..... I'm not sure if this has been asked before, but SalusaSeconds, could you please maybe write a brief tutorial on how to grab the XML into HTML and sticky it? I have some success, but not too much. :)

Like, for example, why the economy one doesn't work. It's probably because it's a subcategory..... Thanks in advance!

<xml id="NATIONINFO" src="http://www.nationstates.net/cgi-bin/nationdata.cgi/nation=Adejaani"></xml>
<br>Population: <span datasrc="#NATIONINFO" datafld="POPULATION"></span>&million
<br>UN Category: <span datasrc="#NATIONINFO" datafld="CATEGORY"></span>
<br>Economy: <span datasrc="#NATIONINFO" datafld="ECONOMY"></span>
SalusaSecondus
03-10-2003, 05:48
Sorry, I'm not that involved with that type of stuff. In fact, I will admit that you seem to know a bit more about the parsing than I do. If I need a program to parse it, I write it in Delphi.

There are some other people on the forums who really do know this stuff, hopefully one them will be able to help.

http://www.weirdozone.0catch.com/projects/nationstates/salusasecondus/salusasecondus2.jpg
SalusaSecondus
Tech Modling
Adejaani
03-10-2003, 06:26
My faith in the mods has just been shaken! :shock: Anyway, thanks for the input, SS.

Anyone else like to contribute? :)
Winnipeg
03-10-2003, 09:06
I have a script that will get all the data for you in PHP, but you're host has to support php, and have the fopen() Function enabled.

Example: http://op2000.net/ns_xml.php

Code: http://op2000.net/ns_xml.phps
Adejaani
03-10-2003, 09:33
Hmm, most interesting, thanks, but that wasn't really what I was looking for. I was asking for HTML, which you can see in the top of the thread. If you put those tags into an HTML page, population and UN Category work, but not economy. :cry: