Thread: XML AND JQUERY
View Single Post
  #3 (permalink)  
Old July 8th, 2009, 06:08 PM
pallone pallone is offline
Friend of Wrox
Points: 1,243, Level: 13
Points: 1,243, Level: 13 Points: 1,243, Level: 13 Points: 1,243, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2003
Location: , , United Kingdom.
Posts: 290
Thanks: 24
Thanked 0 Times in 0 Posts
Default

Hi

Thanks a lot for your reply and sample code.

This is what is being produced by your code. As you can see, this is not the result I was expecting.

<div id="xml">
<names>
Claudio Pallone
</names>
</div>

I would like to build a tree with all name elements and their children from the xml.

Something like:

<names>
<name>Ezra Pound</name>
<name>Thomas Eliot</name>
<name>Langston Hughes</name>
</names>

the text() method gets only the text of the element but not the node and its children. Basically, I am trying to build an xml document.

You mentioned that I could loop each element using the each() method. I was wonderinf if you could provide some source code for us to see how to do that using the xml.

Cheers

C
Reply With Quote