all the attributes are in the attributes object, so you can just do a for...in loop and grab them all.

example:

for(a in xObj.attributes) {
        obj[a] = xObj.attributes[a];
}



On Mar 15, 2007, at 12:19 AM, Carl Welch wrote:

What if I don't know what the names are going to be? How can I check
how many attributes are in a node? is there anything like
<XMLNode>.attributes.length (I know that's wrong...) so I can loop
through and find out their names?

--
Carl Welch
http://www.carlwelch.com
[EMAIL PROTECTED]

On 3/14/07, Andrew Wright <[EMAIL PROTECTED]> wrote:
<XMLNode>.attributes.imageID
<XMLNode>.attributes.img
<XMLNode>.attributes.text

etc
> Hi coders,
>
> I just started working on a new project that is requiring me to handle
> an xml format that I haven't had to deal with yet.
>
> Here is an example of what it looks like:
>
> <image imageID="halLogin" img="hal.png" text=""
> Font="Black,8,Regular,AlignLeft" onPanel="true" xPos="0.25"
> yPos="0.112" />
>
> I'm used to parsing xml that looks like this:
>
> <something>
> <blah>"foo"</blah>
> </something>
>
> How do I parse xml that looks like the first example with multiple
> values inside of a single node?
>
> Thanks.

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to