Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: parsing XML fragments (xml log files) with XML::Parser

by wind (Priest)
on Mar 18, 2011 at 00:07 UTC ( #893879=note: print w/ replies, xml ) Need Help??


in reply to parsing XML fragments (xml log files) with XML::Parser

Could just use XML::Simple and add a root node as needed

use XML::Simple; use Data::Dumper; use strict; my $data = do {local $/; <DATA>}; my $ref = XMLin("<root>$data</root>"); print Dumper($ref); __DATA__ <logentry>...more xml 1...</logentry> <logentry>...more xml 2...</logentry> <logentry>...more xml 3...</logentry>
Then again, that's not an event-based parser. Will consider other possible solutions...


Comment on Re: parsing XML fragments (xml log files) with XML::Parser
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://893879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-07-07 01:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls