Xml

Discussion in 'Software' started by BigR, Mar 4, 2005.

  1. BigR

    BigR Private E-2

    i am trying to take data from an XML page, and place it into a table in my HTML page. but for some reason it is not working.

    this is the html page
    Code:
    <html>
    
    <body>
    <xml
    src="cd_catalog.xml"
    id="xmldso">
    </xml>
    
    <table
    datasrc="#xmldso"
    width="100%"
    border="1">
    
    <thead>
    <th>Title</th>
    <th>Artist</th>
    <th>Year</th>
    </thead>
    
    <tr align="left">
    <td><span datafld="TITLE"></span></td>
    <td><span datafld="ARTIST"></span></td>
    <td><span datafld="YEAR"></span></td>
    </tr>
    </table>
    
    </body>
    </html>
    and this is a portion of the XML page
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE note SYSTEM "InternalNote.dtd">
    - <!--  Edited with XML Spy v4.2 
      --> 
    - <CATALOG>
    - <CD>
      <TITLE>Empire Burlesque</TITLE> 
      <ARTIST>Bob Dylan</ARTIST> 
      <COUNTRY>USA</COUNTRY> 
      <COMPANY>Columbia</COMPANY> 
      <PRICE>10.90</PRICE> 
      <YEAR>1985</YEAR> 
      </CD>
    - <CD>
      <TITLE>Hide your heart</TITLE> 
      <ARTIST>Bonnie Tyler</ARTIST> 
      <COUNTRY>UK</COUNTRY> 
      <COMPANY>CBS Records</COMPANY> 
      <PRICE>9.90</PRICE> 
      <YEAR>1988</YEAR> 
      </CD>
    </CATALOG>
    
    also, can this be run anywhere, or does it need something to be installed on teh server (like PHP)

    thanks
     
  2. goldfish

    goldfish Lt. Sushi.DC

    For a start, get rid of the -'s that got inserted.

    The XML file seems to be formed okay... as far as I can tell on first inspection. Whats strange is one of the artist fields does get displayed, but the rest of the fields are blanks. Strange.

    I'd just like to take a moment to say in the real world this is a very BAD way of importing XML data into a website, since the commands used are (as far as I know) only fully supported by IE. This method does not require you to have anything running on the server, however pretty much all other methods do require you to be running some sort of server side scripting. Client side data handling is patchy and unpredictable to say the least, server side is much more sensible.

    I'll take a look at it though.
     
  3. bot

    bot Private E-2

    you should check out the latest version of cutehtml it has lots of tools for just what your trying to do ...download you'll be happy i'm sure..
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds