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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:03:36+00:00 2026-06-08T09:03:36+00:00

I am building an application which works on data from column based database. I

  • 0

I am building an application which works on data from column based database. I am getting the data as arrays where each array represents a columns in the table returned by the database. The data contain parent, child relationship. The arrays may look like that (view same index in each array as a row in a normal SQL database):

[0] empty   [1] empty   [2] ID-A  [3] ID-B  [4] ID-B <-- this represents nodes' parents  
[0] ID-A    [1] ID-A    [2] ID-B  [3] ID-C  [4] ID-D <-- this represents nodes' labels  
[0] 100     [1] 200     [3] 300   [4] 150   [4] 150  <-- this represents values associated with nodes

Of course they are much bigger. Up to 100000 elements. All I want to do, is create the following XML from the data I have:

<root>  
   <node label="ID-A" value="300">  
      <node label="ID-B" value="300">  
          <node label="ID-C" value="150"/>  
          <node label="ID-D" value="150"/>  
      </node>
   </node>
</root>

Notice that for ID-A there is only one entry at the top level, and it’s value is the sum for all its entries in the array.

I do not know the depth of the structure beforehand and any IDs or values. How do I create the XML so that I will be later able to display it in a tree control? What I want to do is iterate through array, each time adding a node for an ID if it does not exist, but just update the value (add it to the current one) if the ID exists. I can create the first layer, but I have trouble accessing and updating appropriate elements at bigger depths. Basically, how do would I add a ID-E below ID-B to the XML above, in order to achieve the following:

<root>  
   <node label="ID-A" value="300">  
      <node label="ID-B" value="300">  
          <node label="ID-C" value="150"/>  
          <node label="ID-D" value="150"/>  
          <node label="ID-E" value="sth"/>
      </node>
   </node>
</root>

Or would it maybe actually be beter to build an ArrayCollection with children from the arrays I have? I am new to Flex so I can’t tell myself what would be more efficient.

  • 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-08T09:03:38+00:00Added an answer on June 8, 2026 at 9:03 am

    Converting 100k rows into XML could be very slow and XML takes up a lot of memory, which is wasted if it’s just for use as a tree data provider. If you just need to do that to view the data in a tree, perhaps you can keep it in an Array, but use a customer tree dataDescriptor to define the hierarchy. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/Tree.html#dataDescriptor

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

Sidebar

Related Questions

I'm building a iPhone application which depends data from an online database. To update
I am building a Monotouch application which downloads data from the server encrypted using
I'm building a java application which works in a LAN environment, every computer on
I am building an application which stores GPS locations in a SQLite database and
i'm building an android application which have a chat. in this chat i each
I am building an application that has to display data received from an external
I am building application that required some data from iPhone's Call log(read only). The
I'm building an application that needs to store sensitive information, which means the data
I'm building a quiz web application that is dynamically generated from a database on
I am building an application which accepts csv data as an uploaded file. Here

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.