[jQuery] Parsing XML documents (recursive) to array.
Hello. First, I want to present my self. My name is Mario Soto, web
developer (php) in Guatemala. Newbie using jQuery. I'm experiencing
some trouble parsing an xml piece of data.
The thing is that I need a tree that the user can move on the browser.
This is done [http://interface.eyecon.ro/demos/drag_drop_tree.html],
like the demo but code reduced. The problem itself is to resolve the
data to be sended to the server.
The tree itself is formed with lists (ul) and each has list items (li)
of course, but any <li> can have inside a <ul> with its own <li>
elements. I'm not able to get all the nodes and to parse this into an
array or Json data to send to the server. On server side I can arrange
my self (hope to).
I've tried to use a $('#myTree').find('li').each...., but the problem
is that it gets me all <li> items, and not only the items on "the
first level", because is a <li> item that has the other <ul> and some
<li> inside can have <ul> items, and so. That's the big problem. Other
way that I've tryed is using with parentNode, chidrenNodes, and
various variations and combinations of these things. But none worked
for me.
All sugestions that you can give me, it will be very, very welcome.
Mario Soto
mariosoto@cancuen.net
,,,_