PDA

View Full Version : NEWBIE to xml, not binding to html, no display on web


cjwsb
11-26-2003, 04:21 PM
Hi all,

I am a complete XML NEWBIE, so please bear with me if these questions are dumb.

I just wrote my very first xml file ever. I am making a list of all of my mp3's so I can post them on my site. I think I binded it to the html properly, but perhaps not because when I go to the site, all I get is a small box. Here's the url:

http://www.bartlett-family.net/chris/hobbies/

I have provided the html code here, and the xml code below it.

<html>
<body>
<xml id="cdcat" src="music.xml"></xml>
<table border="1" datasrc="#cdcat">
<tr>
<td><span datafld="ARTIST"></span></td>
<td><span datafld="TITLE"></span></td>
</tr>
</table>
</body>
</html>


<?xml version="1.0" encoding="ISO-8859-1" ?>
- <CATALOG>
- <CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
</CD>
- <CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tyler</ARTIST>
</CD>
- <CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
</CD>
- <CD>
<TITLE>Still got the blues</TITLE>
<ARTIST>Gary Moore</ARTIST>
</CD>
- <CD>
<TITLE>Eros</TITLE>
<ARTIST>Eros Ramazzotti</ARTIST>
</CD>
- <CD>
<TITLE>One night only</TITLE>
<ARTIST>Bee Gees</ARTIST>
</CD>
- <CD>
<TITLE>Sylvias Mother</TITLE>
<ARTIST>Dr.Hook</ARTIST>
</CD>
- <CD>
<TITLE>Maggie May</TITLE>
<ARTIST>Rod Stewart</ARTIST>
</CD>
- <CD>
<TITLE>Romanza</TITLE>
<ARTIST>Andrea Bocelli</ARTIST>
</CD>
- <CD>
<TITLE>When a man loves a woman</TITLE>
<ARTIST>Percy Sledge</ARTIST>
</CD>
- <CD>
<TITLE>Black angel</TITLE>
<ARTIST>Savage Rose</ARTIST>
</CD>
- <CD>
<TITLE>1999 Grammy Nominees</TITLE>
<ARTIST>Many</ARTIST>
</CD>
- <CD>
<TITLE>For the good times</TITLE>
<ARTIST>Kenny Rogers</ARTIST>
</CD>
- <CD>
<TITLE>Big Willie style</TITLE>
<ARTIST>Will Smith</ARTIST>
</CD>
- <CD>
<TITLE>Tupelo Honey</TITLE>
<ARTIST>Van Morrison</ARTIST>
</CD>
- <CD>
<TITLE>Soulsville</TITLE>
<ARTIST>Jorn Hoel</ARTIST>
</CD>
- <CD>
<TITLE>The very best of</TITLE>
<ARTIST>Cat Stevens</ARTIST>
</CD>
- <CD>
<TITLE>Stop</TITLE>
<ARTIST>Sam Brown</ARTIST>
</CD>
- <CD>
<TITLE>Bridge of Spies</TITLE>
<ARTIST>T'Pau</ARTIST>
</CD>
- <CD>
<TITLE>Private Dancer</TITLE>
<ARTIST>Tina Turner</ARTIST>
</CD>
- <CD>
<TITLE>Midt om natten</TITLE>
<ARTIST>Kim Larsen</ARTIST>
</CD>
- <CD>
<TITLE>Pavarotti Gala Concert</TITLE>
<ARTIST>Luciano Pavarotti</ARTIST>
</CD>
- <CD>
<TITLE>The dock of the bay</TITLE>
<ARTIST>Otis Redding</ARTIST>
</CD>
- <CD>
<TITLE>Picture book</TITLE>
<ARTIST>Simply Red</ARTIST>
</CD>
- <CD>
<TITLE>Red</TITLE>
<ARTIST>The Communards</ARTIST>
</CD>
- <CD>
<TITLE>Unchain my heart</TITLE>
<ARTIST>Joe Cocker</ARTIST>
</CD>
</CATALOG>

Both of these files (the html and xml files) are in the same server directory. Is there something I need to do to may Apache server to permit xml documents, or is the server irrelevant completely? Again, I'm a xml newbie! Thanks, fellas!

cjwsb
11-26-2003, 06:20 PM
NM, I figured it out!

Chris

cjwsb
11-27-2003, 04:35 AM
Hi again, guys...

I "finished" setting up my xml list at http://www.bartlett-family.net/chris/hobbies

Other than having laughable, archaic code (let's keep the laughter to a minimum, I'm not going for a gold star here :p ), I am pleased with how it looks.

The only other thing I would like to do is to actually have the song TITLES be links that go to the mp3 file itself. Where would I place the anchor? In the xml somehow? In the html somehow? How do I do this? Thanks!

Chris

cjwsb
12-19-2003, 12:48 AM
BroChris,

Take a look at the html source of the site, then look at the 2 files I will attach. They make the xml formatted site work. Just remove the .txt extensions. To answer the question you asked in the PM to me, I honestly don't remember at this point what I fixed. It's been too long, and I have not played with XML since. Still a newbie at it. Anyone know the answer to my links question, BTW? Thanks!

Chris

cjwsb
12-19-2003, 12:48 AM
The other xml file

me'
12-20-2003, 12:29 PM
I can't check now (I'm on a friends PC with stupid stupid AOL parental control that won't let me on the xhtml strict dtd), but I don't think that the <xml> elements exists. The 'proper' way is outlined here (http://www.w3schools.com/xsl/xsl_server.asp) at w3schools, but if your server doesn't support ASP, it would probably be very easy with PHP as well.