Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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!


In reply to Re^2: "PAR'ing" XML configs? by guice
in thread "PAR'ing" XML configs? by guice

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found