Hey Shmem
I think I made my questions confusing. I apologise. Let me rephrase my question:
I have a Perl Hash as shown
$FIELDS = {
'AA' => {
'Description' => '',
'Type' => 'Module',
'File' => 'Sample1.pl',
},
'BB' => {
'Description' => 'Initiator',
'Type' => 'Methods',
'File' => 'Sample1.pl',
},
'CC' => {
'Description' => 'Destructor',
'Type' => 'Methods',
'File' => 'Sample2.pl',
'Values' => {
'1' => 'Ignore',
'2' => 'Retry',
'3' => 'Abort'
}
}
},
I need to convert it to a Valid XML File. I tried using XML::Simple, but it changes '1' to <1> which is invalid XML Tag.
I checked CPAN docs on XML::Simple, and while they talk about KeyAttr ValueAttr, I am unsure How I can do what you and dragonchild suggest.
I wanted to know if I could handle this conversion better using XML::Writer or XML::Twig and if so how?
Thanks,
Bugz
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.