...

View Full Version : Displaying XML with either html or PHP



xxdoubletxx
12-02-2008, 04:00 AM
I need a little assistance with taking an xml feed and displaying it on my page with a little formatting. I have been reading up on parsing with the dom parser however I can't figure out how I can format it on my page. Here is an example of my xml code.


<document>
<band>
<id>0</id>
<name>Houston Calls</name>
<from>New Jersey</from>
<label>Drive Thru</label>
<song>One More Won't Hurt</song>
</band>
<band>
<id>2</id>
<name>Fight Fair</name>
<from>California</from>
<label>Tooth and Nail</label>
<song>No Good News</song>
</band>
<band>
<id>3</id>
<name>Artist Vs Poet</name>
<from>Florida</from>
<label>Unsigned</label>
<song>Here We Go Again</song>
</band>
<band>
<id>4</id>
<name>Foster</name>
<from>New Jersey</from>
<label>Unsigned</label>
<song>Electra</song>
</band>
</document>

I need it to display an image then followed by the content. The image is a url provided by another site so I can't add it to my xml. If possible I want to display it in tables. Here is a simple paint image to get my drift how I want it to look. Here (http://www.forthesound.com/exampleparse.jpg).

I can create a basic javascript code however I can only display the xml in a list.

Alex Vincent
12-02-2008, 07:22 AM
It sounds like you want a combination of CSS and maybe XSLT. The XSLT might be able to query this other XML source for the image URL's, or it may be able to insert a XHTML script to do the querying for you.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum