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 8456651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:36:00+00:00 2026-06-10T12:36:00+00:00

I have some Data Xml.. <main> <TabNavigator x=27 y=11 width=455 height=376 id=gh backgroundColor=#A4B6E9> <NavigatorContent

  • 0

I have some Data Xml..

<main>
  <TabNavigator x="27" y="11" width="455" height="376" id="gh" backgroundColor="#A4B6E9">
    <NavigatorContent width="100%" height="100%" label="Client" id="clientTab"></NavigatorContent>
    <NavigatorContent width="100%" height="100%" label="Admin" id="adminTab"></NavigatorContent></TabNavigator>
    <TitleWindow x="521" y="84" width="377" height="234">
      <DataGrid x="0" y="0" width="375" height="163" borderVisible="true" id="details">
        <columns>
          <ArrayList>
            <GridColumn dataField="Name" id="arrayName"/><GridColumn dataField="Address" headerText="Address"/>
            <GridColumn dataField="Phone_Number" headerText="Phone_Number"/>
          </ArrayList>
        </columns>
      </DataGrid>
      <Button x="139" y="167" height="28" label="Export"/>
    </TitleWindow>
</main>

I use following code for retrieving the child names of given XML..

private function urlLdr_complete(event:Event):void{
var xmlData:XML=new XML(URLLoader(event.currentTarget).data);                       
for each (var t:XML in xmlData.children()) 
{
   Alert.show(t.Name);
}

But I only get 2 children(TabNavigator and TitleWindow).How do I get the other children in each parent node? I want separate children for each parent. How can I get it?

  • 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-06-10T12:36:02+00:00Added an answer on June 10, 2026 at 12:36 pm

    You need to use a recursive function to walk down the tree. Using trace() instead of alert():

    private function urlLdr_complete(event:Event):void
    {
        var xmlData:XML=new XML(URLLoader(event.currentTarget).data);
        showNodeName(xmlData);
    }
    
    private function showNodeName($node:XML):void
    {
        // Trace the current node
        trace($node.name());
        if($node.hasChildNodes)
        {
            for each (var child:XML in $node.children())
            {
                // Recursively call this function on each child
                showNodeName(child);
            }
        }
    }
    

    Or, use the E4X descendants() function:

    private function urlLdr_complete(event:Event):void
    {
        var xmlData:XML=new XML(URLLoader(event.currentTarget).data);
        // Trace the root node:
        trace(xmlData.name());
        // And trace all its descendants:
        for each(var child:XML in xmlData.descendants())
        {
            trace(child.name());
        }
    }
    

    Both should produce identical outcomes:

    main
    TabNavigator
    NavigatorContent
    NavigatorContent
    TitleWindow
    DataGrid
    columns
    ArrayList
    GridColumn
    GridColumn
    GridColumn
    Button
    

    I haven’t tested but I would expect the built-in descendants() function to be more efficient.

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

Sidebar

Related Questions

I have some xml data contained in three files (Database.xml, Participants.xml, and ConditionTokens.xml). I
I have some data in an XML element that looks like this: <?xml version=1.0
I have grabbed some XML data using this piece of jQuery: $.ajax({ type: POST,
I have some data in an SQL table with an XML datatype column where
I have some data in a database that I need represented in an XML
I have to import some XML data into my app. Now I open a
I have one problem , I want to get some data from XML file
I have some non well-formed xml (HTML) data in JAVA, I used JAXP Dom,
I have an SSIS (2005) package that transforms some XML data and then imports
I have a table from a vendor application that stores some xml data into

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.