PDA

View Full Version : childNodes.childNodes.childNodes?


Jerome
03-20-2003, 11:55 AM
Hmm....

Struggeling a bit on the moment, with data I want to display!

I have a xml-file which looks like this:

<?xml version="1.0"?>
<kl2>
<it>
<tp>208</tp>
<lt>1990 - 1992</lt>
<lk>link1</lk>
</it>
<it>
<tp>308</tp>
<lt>1992 - 1994</lt>
<lk>link2</lk>
</it>
<it>
<tp>408</tp>
<lt>1994 - 1996</lt>
<lk>link3</lk>
</it>
<it>
<tp>508</tp>
<lt></lt>
<lk>link4</lk>
</it>
</kl2>

And a javascript-routine like:

var records=xmlDoc.documentElement.childNodes
var content=xmlDoc.getElementsByTagName("kl2")[0].childNodes[0].childNodes[0].firstChild.nodeValue;
dataStr+='<TABLE>';
for(i=0;i<=records.length-1;i++)
{
dataStr+='<TR><TD>'+content+'</TD><TD>'+content+'</TD><TD>'+content+'</TD></TR>';
}
dataStr+='</TABLE>';
MyDIV.innerHTML=dataStr;

Where var content is NOT ok

Because I like to have a table outcome of:

208 1990 - 1992 link1
308 1992 - 1994 link2
408 1994 - 1996 link3
508 link4

Thanks for Your effort!

Jerome

Jerome
03-20-2003, 04:22 PM
Not necessary! I found the solution!

Jerome