0 Replies Latest reply on Jun 11, 2007 11:10 AM by hciguy

    Data storage

      Hey guys,

      I have posted a few times here about my problem but this way seems easiest. I have a class that loads an XML document. Now I need to store the node data. Basically I need to create the following, not hard-coded but dynamically (depending on the number of nodes and levels in the tree):

      nodes["level1a"] = [name, attributes];
      nodes["level1b"] = [name,attributes];
      nodes["level1c"]["level2"] = [name, attributes];
      nodes["level1c"]["level2b"] = [name, attributes];
      nodes["level1c"]["level2b"]["level3"] = [name, attributes];
      nodes["level1d"] = [name,attributes];

      Ad infinitum. Granted anyone can hard code it and I would except who knows how many levels deep the tree goes! Can anyone point me in the right direction of how to make such a structure dynamically?

      Thanks in advance!