Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6785321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:06:45+00:00 2026-05-26T17:06:45+00:00

I am trying to read the below xml file and get the name-value pairs

  • 0

I am trying to read the below xml file and get the name-value pairs in Flex / Actionscript.

Sample.xml

<ABC>
  <XYZ>               // First child
    <id> </id>
    <width> 10 </width>
    <height> 10 </height>
    <name> Person1 </name>
  </XYZ>
  <XYZ>              // Second child
    <id>  </id>
    <width>  20 </width>
    <height> 20 </height>
    <name> Person2 </name>
   </XYZ>
</ABC>

I am trying to use the following all tag name and value details for both childs using .name() and .text() function of XML

But I am not getting it.

My question is,

Can anyone please tell me how to parse this xml to obtain the details
of each child separately in an object and then store that object in
array for later use ?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:06:46+00:00Added an answer on May 26, 2026 at 5:06 pm
            var xml:XML =
                <ABC>
                    <XYZ>               // First child
                        <id> </id>
                        <width> 10 </width>
                        <height> 10 </height>
                        <name> Person1 </name>
                    </XYZ>
                    <XYZ>
                        <id>  </id>
                        <width>  20 </width>
                        <height> 20 </height>
                        <name> Person2 </name>
                    </XYZ>
                </ABC>;
            // Get list of children named XYZ
            var children:XMLList = xml.XYZ;
            for each (var child:XML in children)
            {
                trace(child.name());
                // Get list of inner children (with any name)
                for each (var prop:XML in child.children())
                {
                    // You need text from inner children, so here it is
                    trace("\t" + prop.name() + " = " + prop.text());
                }
            }
    

    Note that your comment (// First child) will become text node with null name in child list.
    Comments in XML are like this:
    <!-- comment -->

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is my code & xml file. I am trying to read a xml
I am trying to read data from a file stream as shown below: fileStream.Read(byteArray,
I'm currently trying to READ XML file from the client machine where the user
I am trying to read the xml from a file and display them just
So I am trying to parse an XML file and display first 150 words
In the code below i`m trying to read a list of selected projects and
Trying to read headers for a csv file with: reader = csv.DictReader(open(PATH_FILE),skipinitialspace=True) headers =
Iam trying to read a binary file to memory and pass the starting address
I am trying to read a CSV file with accented characters with Python (only
I'm trying to read POST data in a PHP script. My first instincts led

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.