|
Posted by laptopalias on 11/27/06 10:45
laptopalias wrote:
> What's the simplest way to produce an array like the one at bottom from
> a snippet of xml like that provided below?
>
> <tables>
> <table1 id="0">
> <table1 id="9">
> <table2 id="10"/>
> <table2 id="12"/>
> </table1>
> <table1 id="10">
> <table2 id="17"/>
> </table1>
> <table1 id="17">
> <table2 id="1"/>
> </table1>
> <table1 id="22"/>
> </table1>
> <table1 id="11">
> <table1 id="12">
> <table2 id="13"/>
> <table2 id="14"/>
> </table1>
> <table1 id="13"/>
> <table1 id="21"/>
> <table1 id="14"/>
> </table1>
> </tables>
>
> (table, id, parent)
> table1,0,null
> table1,9,0
> table2,10,9
> table2,12,9
> table1,10,0
> table2,17,10
> table1,17,0
> table2,1,17
> table1,22,0
> table1,11,null
> table1,12,11
> table2,13,12
> table2,14,12
> table1,13,11
> table1,21,11
> table1,14,11
Navigation:
[Reply to this message]
|