XML parsing in perl

plimbayat's Avatar, Join Date: Oct 2010
Newbie Member
Code:
<SecScan ID="0" DisplayName="DE\AAC11FSR017001" Machine="AAC11FSR017001" Date="2009-05-25 16:05:53" LDate="25.05.2009 16:05" Domain="DE" IP="10.50.103.81" Grade="2" HotfixDataVersion="2009-05-12T06:13:31Z" MbsaToolVersion="2.1.2104.0" IsWorkgroup="False" SUSServer="" HFFlags="20" SecurityUpdatesScanDone="True" WUSSource="Microsoft Update (offline)">
    <IPList><IP addr="171075409" /></IPList>
    <Check ID="104" Grade="5" Type="1" Cat="1" Rank="1" Name="Local Account Password Test" URL1="Help/Check5315.html" URL2="Help/Check5315fix.html" >
        <Advice>Some user accounts (1 of 7) have blank or simple passwords, or could not be analyzed.</Advice>
        <Detail>
            <Head>
                <Col>User</Col>
                <Col>Weak Password</Col>
                <Col>Locked Out</Col>
                <Col>Disabled</Col>
            </Head>
            <Row Grade="0">
                <Col>Guest</Col>
                <Col>Weak</Col>
                <Col>-</Col>
                <Col>Disabled</Col>
            </Row>
            <Row Grade="0">
                <Col>SUPPORT_388945a0</Col>
                <Col>-</Col>
                <Col>-</Col>
                <Col>Disabled</Col>
            </Row>
            <Row Grade="5">
                <Col>ASPNET</Col>
                <Col>-</Col>
                <Col>-</Col>
                <Col>-</Col>
            </Row>
            <Row Grade="5">
                <Col>Administrator</Col>
                <Col>-</Col>
                <Col>-</Col>
                <Col>-</Col>
            </Row>
            <Row Grade="5">
                <Col>IUSR_DUS11FSR499001</Col>
                <Col>-</Col>
                <Col>-</Col>
                <Col>-</Col>
            </Row>
            <Row Grade="5">
                <Col>IWAM_DUS11FSR499001</Col>
                <Col>-</Col>
                <Col>-</Col>
                <Col>-</Col>
            </Row>
            <Row Grade="5">
                <Col>MNUSYNCServer40&amp;</Col>
                <Col>-</Col>
                <Col>-</Col>
                <Col>-</Col>
            </Row>
        </Detail>
    </Check>
Hello Experts,
Please help me with XML parsing in perl from above text.

Last edited by shabbir; 11Oct2010 at 17:35.. Reason: Code blocks
0
chorny's Avatar, Join Date: Jun 2010
Go4Expert Member
Did you try using a module like XML::Smart?

search.cpan.org/perldoc?XML::Smart