Changing flat XML into nested


i'm working on tree navigation needs have data provided in nested xml format

 

<node label="california">

     <node label="location 1" />

     <node label="location 2">

          <node label="option 1" />

          <node label="option 2" />

     </node>

</node>

 

but data i'm getting (and can't change) coming out flat:

 

<item>

     <id>12</id>

     <label>california</label>

</item>

<item>

     <id>15</id>

     <label>location 1</label>

     <parent>12</parent>

</item>

<item>

     <id>17</id>

     <label>location 2</label>

     <parent>12</parent>

</item>

<item>

     <id>33</id>

     <label>option 1</label>

     <parent>17</parent>

</item>

<item>

     <id>70</id>

     <label>loption 2</label>

     <parent>17</parent>

</item>

 

any suggestions on how change data i'm supplied need? brute force looping through xml nodes bunch of times? or there clever way i'm not seeing?

you receive data formatted 1 way , want data re-organized?  if yes, asking?



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support