I have been fiddling with this trying to get XML::Simple to produce the correct xml file.
I have a application written. I have decided that I would take my data structures and convert them to xml.
I have taken the hash structure and tried to convert it.
my %t_type = (
...
'b' => {
a => {low => 1000, high => 3000, percent => 25},
b => {low => 200,high => 2000, percent => 30},
c => {low => 1000,high => 6000, percent => 40},
d => {low => 300,high => 1800, percent => 35},
e => {low => 10, high => 40, percent => 60},
f => {low => 2, high => 12, percent => 50},
g => [
{select => 'new',low => 1,high => 1,percent => 10},
{select => 'expert',low => 1,high => 1,percent => 10},
],
},
...
);
note: the g hash of arrays has at least 1 element but can be more.
In the current xml file output. It creates mutiple g's with 1 entry per g array item. Which when read back in produces a differant struture. This is the options I am using to produce the file.
print L $xsimple->XMLout(
\%t_type,
noattr => 1,
xmldecl => '<?xml version="1.0"?>',
);
I tried the
GroupTags => { '' => 'g' } and
GroupTags => { 'g' => 'select' } but with no success.
any suggestions, solutions.
thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.