The XML is below, i need to read all the entries under <CasualAdvertiser> and not <NewspaperAdvertiser>. Ive looked at XML::Parser but i dont think i will be able to do things like not include the <NewspaperAdvertiser> results, well not in a good way. So i was wondering what parser to use? also if you could give me a little run down on how to use it or where to find a god example of its use. Thanks (the format didnt come out exactly right but it is correctly formatted XML) Pete
<?xml version="1.0" standalone="yes" ?> - <BCCFeed> - <CasualAdvertiser> <AdvertisementID>1580590</AdvertisementID> <FirstName /> <LastName /> <EveningPhone /> <MobilePhone /> <Make>MERCEDES-BENZ</Make> <Family>E220</Family> <ModelVariant>SPECIAL-EDITION</ModelVariant> <Series /> <BodyType>4D SEDAN</BodyType> <SeriesYear>1994</SeriesYear> <Rego>ORV215</Rego> <Price>21500.0000</Price> <Kilometres>175000</Kilometres> <Colour>Almandine</Colour> <InteriorColour /> <Transmission>A</Transmission> <EngineSize>2.2</EngineSize> <Fuel /> <FeaturesVerbose>Air Conditioning, Power Steering, ABS Braking, Powe +r Windows, Cruise Control, Towbar, Air Bags, CD Player, Sunroof, Meta +lic Paint, Full service history</FeaturesVerbose> <Condition>excel</Condition> <Comments>Garaged, leather trim Must sell</Comments> <RegoExpire>Aug 2004</RegoExpire> <Location>VIC - South Eastern</Location> </CasualAdvertiser> - <CasualAdvertiser> <AdvertisementID>1607551</AdvertisementID> <FirstName /> <LastName /> <EveningPhone>0408898011</EveningPhone> <MobilePhone>0408898011</MobilePhone> <Make>MERCEDES-BENZ</Make> <Family>ML</Family> <ModelVariant>320-LUXURY-4x4</ModelVariant> <Series /> <BodyType>4D WAGON</BodyType> <SeriesYear>1999</SeriesYear> <Rego>AHV26M</Rego> <Price>42900.0000</Price> <Kilometres>123000</Kilometres> <Colour>Silver</Colour> <InteriorColour /> <Transmission>A</Transmission> <EngineSize /> <Fuel>Unleaded</Fuel> <FeaturesVerbose>Air Conditioning, Power Steering, ABS Braking, Powe +r Windows, Cruise Control, Air Bags, CD Player, Central Locking Remot +e, Metalic Paint, Roadworthy certificate, Alloy Wheels, Full service +history</FeaturesVerbose> <Condition>immac</Condition> <Comments>Immaculate luxury 4wd with all the usual Merc' quality and + extras. It's fully serviced & optioned up with the luxury pack plus +has quite new tyres all round, long rego, leather interior, woodgrain + inserts, CD stacker, traction control, brake assist, Merc' roof rack +s etc etc. Extremely well looked after - always garaged and no off ro +ad use. Beautiful vehicle in superb condition. Will listen to all rea +listic offers.</Comments> <RegoExpire>Oct 2005</RegoExpire> <Location>QLD - South Eastern QLD</Location> </CasualAdvertiser> <NewspaperAdvertiser> <AdvertisementID>2065338</AdvertisementID> <Make>KIA</Make> <Family>CARNIVAL</Family> <ModelVariant /> <Series /> <BodyType /> <SeriesYear>2004</SeriesYear> <Rego>NF361</Rego> <Price>27500.0000</Price> <Kilometres>19000</Kilometres> <Colour /> <InteriorColour /> <Transmission /> <EngineSize>0.0</EngineSize> <Fuel /> <FeaturesVerbose /> <Condition /> <Comments>KIA CARNIVAL 3/2004, 19,000kms, blue, many extras. $27,500 +. NF361. 0411 090 456 or 02 4626 8620.</Comments> <Location>NSW - Sydney</Location> </NewspaperAdvertiser> </BCCFeed>

In reply to Best Way to parse this XML? by sirius98

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.