Ever tried XML2Object?
Check it out:
http://www.sephiroth.it/file_detail.php?id=129
The only draw back is if there is only one element it won't put it into
an array but an object. To resolve
this I throw it into an array to unify use:
if(!object.xml_element.length)
{
object.xml_element = new Array(object.xml_element);
}
Ciao,
Rob.
Johannes Nel wrote:
xpath statement to get all the artist names "./root/track/artist/text()"
On 5/3/07, Johan Nyberg <[EMAIL PROTECTED]> wrote:
Hi, what I need is basically a class that puts all the data in an
associative array, or numeric, depending on if I'm storing values for
individual nodes, or a "mothernode".
Now I find there is a lot of looping going on every time I have to parse
a XML, and XPath seems more like the thing you want to use if you're
looking for specific data inside the XML - I just want to put all the
data in an Array or Object...
For example:
<root>
<track>
<name></name>
<artist></artist>
</track>
<track>
<name></name>
<artist></artist>
</track>
</root>
I would like it like this: root[track[n]["artist"]]
Regards,
/Johan
--
Johan Nyberg
Web Guide Partner
Sergels Torg 12, 8 tr
111 57 Stockholm
070 - 407 83 00
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com