Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Best Way to parse this XML?

by perlsen (Chaplain)
on Mar 14, 2005 at 11:12 UTC ( [id://439226]=note: print w/replies, xml ) Need Help??


in reply to Best Way to parse this XML?

Hi, if you need to get the text in between CasualAdvertiser tag try below code
parser error:
in your file & should be changed in to amp; entity name
then the following code can give the output text

use XML::Twig; my $twig = new XML::Twig( TwigRoots => { 'CasualAdvertiser' => \&outpu +t_title }); $twig->parsefile( shift @ARGV ); sub output_title { ( $tree, $elem) = @_; print $elem->text, "\n\n"; } output: ********** 1580590MERCEDES-BENZE220SPECIAL-EDITION4D SEDAN1994ORV21521500.0000175 +000Almandi neA2.2Air Conditioning, Power Steering, ABS Braking, Powe r Windows, Cruise Control, Towbar, Air Bags, CD Player, Sunroof, Meta lic Paint, Full service historyexcelGaraged, leather trim Must sellAug + 2004VIC - South Eastern 160755104088980110408898011MERCEDES-BENZML320-LUXURY-4x44D WAGON1999AH +V26M42900. 0000123000SilverAUnleadedAir 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 historyimmacImmaculate 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.Oct 2005QLD - South Eastern QLD

Replies are listed 'Best First'.
Re^2: Best Way to parse this XML?
by sirius98 (Acolyte) on Mar 19, 2005 at 02:08 UTC
    Thank you all for your responses it seems XML::Twig is exactly what i was looking for, i havent tried it yet but from what ive read here it will do the job. I will get back to you and let you know how it goes. Pete

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://439226]
help
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-04-25 12:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found