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

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!


Comment on Re^2: "PAR'ing" XML configs?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://481981]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2015-07-29 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls