xml to html

Message boards : Number crunching : xml to html

To post messages, you must log in.

AuthorMessage
Mr. Majestic
Avatar

Send message
Joined: 18 Dec 07
Posts: 35
Credit: 6,285
RAC: 0
Message 51798 - Posted: 4 Mar 2008, 19:43:20 UTC

Can anyone explain to me the easiest way to turn an XML document to html? Any help would be greatly appreciated.

ID: 51798 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile adrianxw
Avatar

Send message
Joined: 18 Sep 05
Posts: 653
Credit: 11,665,420
RAC: 588
Message 51868 - Posted: 9 Mar 2008, 14:37:51 UTC
Last modified: 9 Mar 2008, 14:42:38 UTC

There is no one way to convert XML to HTML. They are different "languages" for different things. XML is a platform independent way of transferring data between co-operating but potentially very different systems. HTML is a way of formatting data.

<Item>1</Item>
<Item>2</Item>
<Item>3</Item>
<Item>4</Item>
<Item>5</Item>

Simple bit of XML, but is that to be presented as paragraphs of text? As a list? As bullet points? In a table? Red, blue? Etc.

If you had a specific XML structure, and a specific format, that would be different. I wrote some of my teams stats pages. These are mostly XML source and HTML/CSS displays. I use Perl to do that.
Wave upon wave of demented avengers march cheerfully out of obscurity into the dream.
ID: 51868 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
AlphaLaser

Send message
Joined: 19 Aug 06
Posts: 52
Credit: 3,327,939
RAC: 0
Message 52006 - Posted: 18 Mar 2008, 20:53:13 UTC

Depends on what you want to do, but you may want to look into XSLT stylesheets.
ID: 52006 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Mr. Majestic
Avatar

Send message
Joined: 18 Dec 07
Posts: 35
Credit: 6,285
RAC: 0
Message 52027 - Posted: 19 Mar 2008, 23:23:35 UTC

What I want to do is take the xml file from http://boinc.netsoft-online.com/get_user.php?cpid=#### and turn it into an html table. I would like to use php to do this.

ID: 52027 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Profile Feet1st
Avatar

Send message
Joined: 30 Dec 05
Posts: 1755
Credit: 4,690,520
RAC: 0
Message 52039 - Posted: 20 Mar 2008, 15:09:25 UTC

Something like is described here??
http://www.thescripts.com/forum/thread621744.html
Add this signature to your EMail:
Running Microsoft's "System Idle Process" will never help cure cancer, AIDS nor Alzheimer's. But running Rosetta@home just might!
https://boinc.bakerlab.org/rosetta/
ID: 52039 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
Mr. Majestic
Avatar

Send message
Joined: 18 Dec 07
Posts: 35
Credit: 6,285
RAC: 0
Message 52051 - Posted: 21 Mar 2008, 0:20:07 UTC - in response to Message 52039.  

Something like is described here??
http://www.thescripts.com/forum/thread621744.html

Yes that is about what I want to do, thanks.

In case anyone has more info here is an example of the xml file in question:
<user>
<total_credit>32847</total_credit>
<expavg_credit>538</expavg_credit>
<expavg_time>1206000004</expavg_time>
<cpid>8d9a4e081977b2a7e0136124bd3f4bcd</cpid>
<name>Albert Einstein</name>
<world_rank_total_credit>209170</world_rank_total_credit>
<world_rank_expavg_credit>34768</world_rank_expavg_credit>
−
	<project>
<name>SETI@home</name>
<url>http://setiathome.berkeley.edu/</url>
<total_credit>28448</total_credit>
<expavg_credit>524</expavg_credit>
<project_rank_total_credit>129348</project_rank_total_credit>
<project_rank_expavg_credit>17170</project_rank_expavg_credit>
<id>8753200</id>
<create_time>1196035541</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<user_url>statistics.coolpage.biz/cpg1416/index.php</user_url>
<team_id>134805</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>2</computer_count>
</project>
−
	<project>
<name>SIMAP</name>
<url>http://boinc.bio.wzw.tum.de/boincsimap/</url>
<total_credit>818</total_credit>
<expavg_credit>4</expavg_credit>
<project_rank_total_credit>13872</project_rank_total_credit>
<project_rank_expavg_credit>5886</project_rank_expavg_credit>
<id>33508</id>
<create_time>1197932510</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<team_id>1695</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>2</computer_count>
</project>
−
	<project>
<name>Rosetta@home</name>
<url>https://boinc.bakerlab.org/rosetta/</url>
<total_credit>296</total_credit>
<expavg_credit>1</expavg_credit>
<project_rank_total_credit>144571</project_rank_total_credit>
<project_rank_expavg_credit>49592</project_rank_expavg_credit>
<id>228507</id>
<create_time>1198012392</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<team_id>7064</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>3</computer_count>
</project>
−
	<project>
<name>uFluids</name>
<url>http://www.ufluids.net/</url>
<total_credit>634</total_credit>
<expavg_credit>2</expavg_credit>
<project_rank_total_credit>6278</project_rank_total_credit>
<project_rank_expavg_credit>2946</project_rank_expavg_credit>
<id>19568</id>
<create_time>1199384348</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<team_id>1155</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>3</computer_count>
</project>
−
	<project>
<name>MilkyWay@home</name>
<url>http://milkyway.cs.rpi.edu/milkyway/</url>
<total_credit>470</total_credit>
<expavg_credit>0</expavg_credit>
<project_rank_total_credit>1696</project_rank_total_credit>
<project_rank_expavg_credit>2382</project_rank_expavg_credit>
<id>2094</id>
<create_time>1199761065</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<team_id>273</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>2</computer_count>
</project>
−
	<project>
<name>SETI@home Beta</name>
<url>http://setiweb.ssl.berkeley.edu/beta/</url>
<total_credit>1381</total_credit>
<expavg_credit>6</expavg_credit>
<project_rank_total_credit>2771</project_rank_total_credit>
<project_rank_expavg_credit>1012</project_rank_expavg_credit>
<id>8226</id>
<create_time>1200853223</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<team_id>920</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>2</computer_count>
</project>
−
	<project>
<name>Cosmology@Home</name>
<url>http://www.cosmologyathome.org/</url>
<total_credit>800</total_credit>
<expavg_credit>1</expavg_credit>
<project_rank_total_credit>4029</project_rank_total_credit>
<project_rank_expavg_credit>3457</project_rank_expavg_credit>
<id>6009</id>
<create_time>1201397712</create_time>
<country>United States</country>
<user_name>Albert Einstein</user_name>
<team_id>567</team_id>
<team_name>SETI@Ohio</team_name>
<computer_count>1</computer_count>
</project>
</user>


ID: 52051 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote

Message boards : Number crunching : xml to html



©2024 University of Washington
https://www.bakerlab.org