Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts

    childNodes.childNodes.childNodes?

    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

  • #2
    Regular Coder
    Join Date
    Oct 2002
    Posts
    299
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not necessary! I found the solution!

    Jerome


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •