Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Displaying XML with either html or PHP

    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.
    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.

    I can create a basic javascript code however I can only display the xml in a list.
    Last edited by Alex Vincent; 12-02-2008 at 07:21 AM. Reason: adding code tags

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    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.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •