Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use XML::Twig; use Data::Dumper; my $xml = qq|<?xml version="1.0" encoding="ISO-8859-1"?> <CustDetails> <CustName>Unix</CustName> <CustomerId>999</CustomerId> <Age>28</Age> </CustDetails> |; my $t= XML::Twig->new( twig_handlers => { 'CustDetails/CustomerId' => sub { $_->pri +nt } } ) ->parsefile($xml); warn Dumper $t;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing XML
by Corion (Patriarch) on Sep 02, 2016 at 15:40 UTC | |
by Anonymous Monk on Sep 02, 2016 at 15:54 UTC | |
by Corion (Patriarch) on Sep 02, 2016 at 15:59 UTC | |
by Anonymous Monk on Sep 02, 2016 at 16:27 UTC | |
by Corion (Patriarch) on Sep 02, 2016 at 16:37 UTC | |
by Anonymous Monk on Sep 02, 2016 at 17:49 UTC | |
by AnomalousMonk (Archbishop) on Sep 02, 2016 at 18:30 UTC | |
by Anonymous Monk on Sep 02, 2016 at 17:22 UTC | |
by Corion (Patriarch) on Sep 02, 2016 at 17:36 UTC | |
|
Re: Parsing XML
by neilwatson (Priest) on Sep 02, 2016 at 15:40 UTC |