Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: "PAR'ing" XML configs?

by guice (Scribe)
on Aug 08, 2005 at 19:15 UTC ( #481981=note: print w/replies, xml ) Need Help??

in reply to Re: "PAR'ing" XML configs?
in thread "PAR'ing" XML configs?

It is far more complex than that. A small taste of it (a bit large to write it out fully)
<opt> <tmpl_xml> <table> <pkey>key1</pkey> <pkey>ky2</pkey> </table> </tmpl_xml> <config> <bad_procs> <proc name="procd" /> <proc name="procd2"> <exempt>hostname</exempt> </proc> </bad_procs> <perm_checks> <file group="grp" path="/etc" user="user" perm="00755" /> </perm_checks> <oneliners> <command id="non-root RC scripts"> find /etc/rc?.d /etc/init.d ! -user root </command> </oneliners> </config> </opt>

There's really much more than that, but it's just a small sample of it. It's a configuration audit check/data collector for remote systems. The config is to define all files to capture, processes to check good/bad, exceptions, port checks, etc.... It's actually a rather large XML file (443 lines--244 lines with AttrIndent off). Currently I'm using XML::Simple to parse it, but not sure if that's really the best way to parse it. But for now, it's the only possible resource I have (can't compile expact due removal of our compile tools).

sometimes it's a PITA to get XML::Simple to parse or write how you want it to

Yeah, fully aware of that. This is why I'm starting with the config file. I'm getting it exactly the way I want it and getting it parsed just how I want it with XML::Simple. Right now, everything's pretty much near perfect (I have to access my one-liners one more hash level than I'd like, but it's no biggy--only an additiona 8 characters to type in my code, once).

-- philip
We put the 'K' in kwality!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://481981]
[bounim]: yo

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2018-01-21 22:44 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (230 votes). Check out past polls.