Displaying repeated XML elements in HTML

admin

Administrator
Staff member
Hi. I am making a trial XML database to learn about XML, and have come across a small hitch!

Here is a segment of the XML file I have produced:

<artwork>
<title>American Gothic</title>
<artist>
<name>Grant Wood</name>
<nationality>American</nationality>
<birth>1891</birth>
<death>1942</death>
</artist>
<description>
<content>
<para>Grant Woods American Gothic caused a stir...</para>
<para>American Gothic remains one of the most...</para>
</content>
</description>
</artwork>

(It has a root node 'artcollection', and more fields and records).

My problem is that when I try and display this in HTML, I cannot access the 'para' field in 'content' (it displays nothing). This is the code segment I *think* should work:

<xml src=http://www.webdeveloper.com/forum/archive/index.php/"art.xml" id="xmldso" async="false"></xml>
<table dataFld="CONTENT" dataSrc="#xmldso">
<tr>
<td><span datafld="PARA"></span></td>
</tr>
</table>

This works if there is only one'para' node, but obviously it is desirable to have more than one paragraph in each description.

How can I display these repeated elements? :confused:

Thanks in advance,
Paul
 
Back
Top