Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Problem getting XML from external source

Reply
Thread Tools

Problem getting XML from external source

 
 
Karsten Kryger Hansen
Guest
Posts: n/a
 
      08-05-2003
Hi

I have a problem with getting XML to my HTML. The question may be quite
simple, but I have strugled with it all day, so please help.

A newsprovider (with whom I have a deal) has the following XML on their
homepage:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE nyheder SYSTEM "http://borsen.dk/homenews/xml/homenews.dtd">
<nyheder>
<nyhed>
<tid>19:57</tid>
<overskrift><a
href="http://www.somewhere.dk/todays-news/index?ids[]=53705">News
1</a></overskrift>
</nyhed>
<nyhed>
<tid>19:27</tid>
<overskrift><a
href="http://www.somewhere.dk/todays-news/index?ids[]=53704">News
2</a></overskrift>
</nyhed>
</nyheder>

And the dtd-file contains the following:

<!ELEMENT nyheder (nyhed*)>
<!ELEMENT nyhed (tid,overskrift)>
<!ELEMENT tid (#PCDATA)>
<!ELEMENT a (#PCDATA)>
<!ELEMENT overskrift (a)>
<!ATTLIST a href CDATA #IMPLIED>

---------------

So now the question. I would like to include the above news (nyheder=news)
on my page. I have tried with the following code, which displayes the time
(tid=time), but not the content with the link (the 'Overskrift' tag).

<xml src="http://www.somewhere.dk/homenews/xml/homenews.xml" id="xmldso"
async="false">
</xml>

<table datasrc="#xmldso" border="1">

<thead>
<th>Tid</th>
<th>Overskrift</th>
</thead>

<tr align="left">
<td><div datasrc="#xmldso" datafld="tid"></div></td>
<td><div datasrc="#xmldso" datafld="overskrift"></div>
</td>
</tr></table>

What am I doing wrong. Your help is much appreciated.

Regards,
Karsten, Denmark


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting my PC to recognise an external drive Hungerdunger Computer Support 7 07-23-2006 02:28 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Problem getting external DTD file running JDOM SAXBuilder Kent Lichty Java 0 07-02-2004 04:15 PM
Help: getting data from an external xml file Mauro Improta XML 0 02-23-2004 10:53 AM
Help: getting data from an external xml file Mauro Improta XML 0 02-12-2004 02:51 PM



Advertisments