my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes xml's nested same element  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml Watch "xml New topic
Author

xml's nested same element

Mortin kim
Ranch Hand

Joined: Nov 15, 2007
Posts: 44
Hi.,
I have one simple problem..on how to read xml doc nested same element..

Problem is like this :

XML File :
a sample xml file

<testxml>
<sonname>
<Fname>aaa</Fname>
<Lname>bbb</Lname>
</sonname>
<Fathername>
<Fname>aaa</Fname>
<Lname>bbb</Lname>
</Fathername>
</testxml>

to papulate the values into filed I am doing like this..

document.getElementById('Fname').value = xmlDoc.getElementsByTagName("Fname")[0].childNodes[0].nodeValue;
document.getElementById('Lname').value = xmlDoc.getElementsByTagName("Lname")[0].childNodes[0].nodeValue;

But how to get the nested same elment Fname,Lname of <Fathername> node..?

Thanks
Kim
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: xml's nested same element
 
Similar Threads
parsing the xml returned from ajax call
object required in java script error
Sorting xml string
XML Info Database Help
Creating table inside div