Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

XML & hashes...Need to know which xml parser could handle this

by Sombrerero_loco (Beadle)
on Jan 08, 2009 at 15:52 UTC ( #734929=perlquestion: print w/replies, xml ) Need Help??

Sombrerero_loco has asked for the wisdom of the Perl Monks concerning the following question:

Hi monk-seekers!

Im again at the temple door to request you knowledge. I have an "weird" XML file that dont complain with any xml standard and i achieve to load into a hash. Now my hash has (he he) the next structure:
%warehouse{$name}{"SID"} = $name {$level} = from 1 to 18 {"service") = only for control {"sons"} = array with the his sons {"father") = $fathername (adquired before)
I need to get and xml like:
$fathername $son1 son1 son2 son3 son1 son1 son2 son1 son2
How its the better way to do that? maybe reorganizing my hash into another hash to has the structure then write out using and xml parser? or there's any xml that can handle that?

The $level represents the absolute deep of the element in the hierarchy, maybe this could be usefull.

Thanks for the efforts of your minds in advance.

Replies are listed 'Best First'.
Re: XML & hashes...Need to know which xml parser could handle this
by moritz (Cardinal) on Jan 08, 2009 at 16:22 UTC
    If I understood what you want, you can try XML::Simple, but I'm not sure if it does exactly what you want (maybe you need to play with the ValueAttr option a bit).
      thank you...i'll try...maybe i need to reorganize my hash into another hash using some kindof hask key auto creation...maybe anyone can tell me something.. :)

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://734929]
Approved by Bloodnok
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2022-08-15 00:41 GMT
Find Nodes?
    Voting Booth?

    No recent polls found