Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I haven't written a line in Perl in 10 years but I was asked to turn this:
<?xml version="1.0" encoding="UTF-8"?> <sub-group-tree> <host-group host-baselines="true" suppress-excluded-services="true +" inverse-suppression="false" host-trap="false" name="inside-hosts"> <host-group id="65534" name="Catch All" host-baselines="true" +suppress-excluded-services="true" inverse-suppression="false" host-tr +ap="false"> <ip-address-ranges>10.0.0.0/8</ip-address-ranges> <ip-address-ranges>192.168.0.0/16</ip-address-ranges> </host-group> <host-group id="23" name="By Function" host-baselines="true" s +uppress-excluded-services="true" inverse-suppression="false" host-tra +p="false"> <host-group id="61" name="B2B" host-baselines="true" suppr +ess-excluded-services="true" inverse-suppression="false" host-trap="f +alse"> <ip-address-ranges>192.168.0.0/16, 192.167.0.0/16, 192 +.166.0.0/16</ip-address-ranges> </host-group> <host-group id="24" name="DMZ" host-baselines="true" suppr +ess-excluded-services="true" inverse-suppression="false" host-trap="f +alse"> <ip-address-ranges>192.168.0.1/16, 192.167.0.1/16, 192 +.166.0.1/16</ip-address-ranges> </host-group> <host-group id="139" name="Guest and Mobile Networks" host +-baselines="true" suppress-excluded-services="true" inverse-suppressi +on="false" host-trap="false"> <host-group id="55" name="CAG_Mobile" host-baselines=" +true" suppress-excluded-services="true" inverse-suppression="false" h +ost-trap="false"> <ip-address-ranges>10.126.0.0/16, 10.127.0.0/16, 1 +0.128.0.0/16</ip-address-ranges> </host-group> <host-group id="59" name="Guest Catch-All" host-baseli +nes="true" suppress-excluded-services="true" inverse-suppression="fal +se" host-trap="false"> <ip-address-ranges>10.126.0.0/16, 10.127.0.0/16</i +p-address-ranges> </host-group> <host-group id="45" name="Guest Wireless Networks" hos +t-baselines="false" suppress-excluded-services="true" inverse-suppres +sion="false" host-trap="false"> <ip-address-ranges>192.168.0.0/16, 192.167.0.0/16, + 192.166.0.0/16</ip-address-ranges> </host-group> </host-group> <host-group id="35" name="Infrastructure" host-baselines=" +true" suppress-excluded-services="true" inverse-suppression="false" h +ost-trap="false"> <host-group id="8" name="Firewalls" host-baselines="tr +ue" suppress-excluded-services="true" inverse-suppression="false" hos +t-trap="false"> <ip-address-ranges>192.168.0.1/16</ip-address-rang +es> <ip-address-ranges>192.168.0.2/16</ip-address-rang +es> </host-group> <host-group id="11" name="NAT Gateway" host-baselines= +"true" suppress-excluded-services="true" inverse-suppression="false" +host-trap="false" /> <host-group id="39" name="Network Devices" host-baseli +nes="true" suppress-excluded-services="true" inverse-suppression="fal +se" host-trap="false"> <ip-address-ranges>192.168.0.1/16</ip-address-rang +es> <ip-address-ranges>192.168.0.2/16</ip-address-rang +es> <ip-address-ranges>192.168.0.1/16</ip-address-rang +es> <ip-address-ranges>192.168.0.2/16</ip-address-rang +es> <ip-address-ranges>192.168.0.1/16</ip-address-rang +es> <ip-address-ranges>192.168.0.2/16</ip-address-rang +es> </host-group> </host-group> <host-group id="7" name="Internal 3rd Party Managed Device +s" host-baselines="true" suppress-excluded-services="true" inverse-su +ppression="false" host-trap="false" /> <host-group id="6" name="Other" host-baselines="true" supp +ress-excluded-services="true" inverse-suppression="false" host-trap=" +false"> <host-group id="18" name="Broadcast" host-baselines="t +rue" suppress-excluded-services="true" inverse-suppression="false" ho +st-trap="false"> <ip-address-ranges>255.0.0.0/8</ip-address-ranges> </host-group> <host-group id="17" name="Link-Local" host-baselines=" +true" suppress-excluded-services="true" inverse-suppression="false" h +ost-trap="false"> <ip-address-ranges>169.254.0.0/16</ip-address-rang +es> </host-group> <host-group id="19" name="Localhost" host-baselines="t +rue" suppress-excluded-services="true" inverse-suppression="false" ho +st-trap="false"> <ip-address-ranges>127.</ip-address-ranges> </host-group> <host-group id="14" name="Multicast" host-baselines="t +rue" suppress-excluded-services="true" inverse-suppression="false" ho +st-trap="false"> <ip-address-ranges>192.0.0.0/24</ip-address-ranges +> </host-group> </host-group> <host-group id="5" name="Users" host-baselines="false" sup +press-excluded-services="true" inverse-suppression="false" host-trap= +"false"> <host-group id="3" name="Desktops" host-baselines="fal +se" suppress-excluded-services="true" inverse-suppression="false" hos +t-trap="false" /> <host-group id="33" name="Remote VPN IP Pool" host-bas +elines="false" suppress-excluded-services="true" inverse-suppression= +"false" host-trap="false" /> </host-group> <host-group id="12" name="VoIP" host-baselines="false" sup +press-excluded-services="true" inverse-suppression="false" host-trap= +"false"> <host-group id="37" name="Endpoints" host-baselines="t +rue" suppress-excluded-services="true" inverse-suppression="false" ho +st-trap="false" /> <host-group id="13" name="Gateways" host-baselines="tr +ue" suppress-excluded-services="true" inverse-suppression="false" hos +t-trap="false"> <ip-address-ranges>192.168.0.1/16</ip-address-rang +es> </host-group> </host-group> </host-group> <host-group id="43" name="By Location" host-baselines="false" +suppress-excluded-services="false" inverse-suppression="false" host-t +rap="false"> <host-group id="77" name="Amhearst" host-baselines="true" +suppress-excluded-services="true" inverse-suppression="false" host-tr +ap="false"> <ip-address-ranges>10.10.10.1/16</ip-address-ranges> <ip-address-ranges>192.168.0.0/16</ip-address-ranges> </host-group> <host-group id="79" name="Springfield" host-baselines="tru +e" suppress-excluded-services="true" inverse-suppression="false" host +-trap="false"> <ip-address-ranges>192.168.0.1/24</ip-address-ranges> </host-group> </host-group> </host-group> </sub-group-tree>
Into this:
Group.Servers.AllServers 10.100.10.0/24 Group.Servers.Mail 10.100.1.10/32 Group2.Development.Lab 172.16.0.0/22 Group2.Development.Linux 172.16.12.9/32
I've been working on this for 12 hours and have gotten just about nowhere. Could somebody provide me some guidance? Anything to get me going in the right direction? I'm completely swimming. Thanks!

In reply to Nested XML Question by zelet

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 avoiding work at the Monastery: (3)
As of 2024-04-19 22:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found