Displaying XML in a HTML table

admin

Administrator
Staff member
Hi all :)

i am trying to display an xml document in a html table and am having some difficulties. The main problem is that when i have more than 1 <newsparagraph> tag in the <newsItem> tag -> the data is not displayed .

Am i nesting incorrectly???

i want the row in the first table repeated for every newsItem in the doc and the second table to be repeated for every <newsParagraph> in each <newsItem>

Any help??? suggestions??? :confused:

Thanks a million for your time
Warm Regards
Aoife

----------------------------------------------
XML Document
----------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<news>
<newsItem>
<headline>My First headline</headline>
<newsParagraph>My first paragraph</newsParagraph>
</newsItem>

<newsItem>
<headline>My second headline</headline>
<newsParagraph>My second paragraph.</newsParagraph>
<newsParagraph>My third paragraph.</newsParagraph>
</newsItem>
</news>


----------------------------------------
HTML for TABLE
----------------------------------------
<xml src=http://www.webdeveloper.com/forum/archive/index.php/"config/news.xml" id="newsxml" async="false"></xml>

<table datasrc="#newsxml" width="100%" border="0">
<tr align="left">
<td>
<h3><span datafld="headline"></span></h3>
</td>
</tr>
<tr>
<td>
<table datasrc="#newsxml">
<tr>
<p><span datafld="newsParagraph"></span></p>
</tr>
</table>
</td>
</tr>
</table>
 
Back
Top