in reply to parsing & retrieving from an XML file
I'd use Path::Tiny to read the file into a variable ($xml), then Mojo::DOM to process it, e.g.
# no XML declaration, in example provided # so no auto detect fancyness, force xml mode: my $dom = Mojo::DOM->new->xml(1)->parse( $xml ); for my $e ( $dom->find('ENVDETAILS')->each ){ say $e->{id}; }
Familiarise yourself with Mojo::DOM, use it to filter the data based upon your other requirements, post your attempts and how they failed. See also this example using selectors to get just the data required.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: parsing & retrieving from an XML file
by sbafna (Novice) on Nov 07, 2017 at 08:06 UTC |