A Tip on using XML Class methods on XMLList Objects.

For using the XML Class methods with an XMLList Object containing one or more XML Objects you have to iterate through the XMLList Collection and apply the XML Class methods to each XML Object in the Collection.

For example use the for each.. in statement to iterate through the XMLList Collection and access the individual XML Objects and apply the required XML Class methods to the individual XML Objects.

Example:

Suppose i have an XMLList Like below

<firstwife>

<name>Aish</name>

<age>35</age>

<dob>12/10/1974</dob>

</firstwife>

<secoundwife>

<name>Anu</name>

<age>25</age>

<dob>10/12/1984</dob>

</secoundwife>

then i would iterate this XMLList like below,

for each(var xml:XML in resultXMLList)

{

trace(“ ”+xml);//now apply XML Class methods to this XML Object.

}

[Here resultXMLList is my XMLList]

Observe the output now,it will print out the individual XML’s.Enjoy the post.

Advertisements

One Response to A Tip on using XML Class methods on XMLList Objects.

  1. sonicrafter says:

    Great post. Hope to read much more excellent posts in the future.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: