in reply to A data structure for XML generation
If you require each array to have the following format you can complete eliminate the array around the child tags. The position alone is enough to determine whether or not an array element is a nested tag. Eliminating the extra square brackets around each tag set would help keep the indentation from going halfway across the page or more.
[0] tag name [1] attribute hash reference [2] data [3] ...: one array ref for each nested tag
Your sample data would then look like this:
[ family => { name => 'Kawasaki' } => undef, [father => {} => 'Yasushisa' ], [mother => {} => 'Chizuko' ], [children => {} => undef, [girl => {} => 'Shiori'], [boy => {} => 'Yasuke'], [boy => {} => 'Kairi'] ] ]
Best, beth
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A data structure for XML generation
by dolmen (Beadle) on Aug 12, 2009 at 23:50 UTC | |
by dolmen (Beadle) on Aug 13, 2009 at 00:08 UTC |