Problem getting XML from external source

Discussion in 'XML' started by Karsten Kryger Hansen, Aug 5, 2003.

  1. 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
    Karsten Kryger Hansen, Aug 5, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kent Lichty
    Replies:
    0
    Views:
    4,294
    Kent Lichty
    Jul 2, 2004
  2. Mauro Improta
    Replies:
    0
    Views:
    359
    Mauro Improta
    Feb 12, 2004
  3. Mauro Improta
    Replies:
    0
    Views:
    397
    Mauro Improta
    Feb 23, 2004
  4. Scott Allen
    Replies:
    8
    Views:
    10,905
    Scott Allen
    May 2, 2004
  5. Mellow Crow
    Replies:
    6
    Views:
    409
    Richard Cornford
    Nov 4, 2005
Loading...

Share This Page