Name: A fag 2011-05-31 18:03
Dear faggots:
First, some background
I just have XML::Parser and XML::Writer available, nothing else.
Language is perl 5.8.8
I have this XML. I have succesfully read this in memory, modified it, and now i have to write it back.
The XML in need to write:
The data structure:
$VAR1 = [
'userdef',
[
{
'src' => 'CustomDef',
'depends' => ''
},
0,
'
',
'port',
[
{},
0,
'
',
'Group',
[
{
'NAME' => 'DPV',
'GID' => 'ID_T1234',
'TYPE' => 'TOP',
'NTYPE' => 'ROOT'
},
0,
'
',
'Group',
[
{
'NAME' => 'TEST_DPV',
'GID' => 'ID_T9999',
'TYPE' => 'BOOK'
},
0,
'
',
'Position',
[
{
'RANKING' => '0',
'SEC_ID' => 'BD-TEST-1',
'POS' => '100'
}
],
0,
'
',
'Position',
[
{
'RANKING' => '0',
'SEC_ID' => 'BD-TEST-2',
'POS' => '200'
}
],
0,
'
'
],
0,
'
'
],
0,
'
'
],
0,
'
'
]
];
I can't make a recursive algorithm to write this?
Care to help? If you do, i will donate 10 bucks to the FSF.
First, some background
I just have XML::Parser and XML::Writer available, nothing else.
Language is perl 5.8.8
I have this XML. I have succesfully read this in memory, modified it, and now i have to write it back.
The XML in need to write:
<userdef depends="" src="CustomDef">
<port>
<Group NTYPE="ROOT" NAME="DPV" TYPE="TOP" GID="ID_T1234">
<Group NAME="TEST_DPV" TYPE="BOOK" GID="ID_T9999">
<Position RANKING="0" POS="100" SEC_ID="BD-TEST-1"/>
<Position RANKING="0" POS="200" SEC_ID="BD-TEST-2"/>
</Group>
</Group>
</port>
</userdef>The data structure:
$VAR1 = [
'userdef',
[
{
'src' => 'CustomDef',
'depends' => ''
},
0,
'
',
'port',
[
{},
0,
'
',
'Group',
[
{
'NAME' => 'DPV',
'GID' => 'ID_T1234',
'TYPE' => 'TOP',
'NTYPE' => 'ROOT'
},
0,
'
',
'Group',
[
{
'NAME' => 'TEST_DPV',
'GID' => 'ID_T9999',
'TYPE' => 'BOOK'
},
0,
'
',
'Position',
[
{
'RANKING' => '0',
'SEC_ID' => 'BD-TEST-1',
'POS' => '100'
}
],
0,
'
',
'Position',
[
{
'RANKING' => '0',
'SEC_ID' => 'BD-TEST-2',
'POS' => '200'
}
],
0,
'
'
],
0,
'
'
],
0,
'
'
],
0,
'
'
]
];
I can't make a recursive algorithm to write this?
Care to help? If you do, i will donate 10 bucks to the FSF.