in reply to Duplicate entries with nested xml
Try this:
use strict; use warnings; use XML::LibXML; my $file = qq(appsimage_EBSB4.xml); open my $fh, '<', $file; binmode $fh; my $doc = XML::LibXML->load_xml(IO => $fh); close $fh; print $doc->toString(); __END__ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE clone [ <!ENTITY envPageConfig SYSTEM "./envPageConfig.xml"> ]> <clone-config> <comt4> <bolinfpwd>welcome</bolinfpwd> </comt4> </clone-config>
Edit: forgot my $doc :-(
Please note: your entity should be written as &envPageConfig;, not "&envPageConfig";.
Update:
This might be helpful too:
use strict; use warnings; use XML::Twig; use Data::Dumper; my $file = qq(appsimage_EBSB4.xml); my $hash_ref = XML::Twig->new()->parsefile( $file )->simplify(); print Dumper($hash_ref); print $hash_ref->{comt4}->{bolinfpwd};
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Duplicate entries with nested xml
by tobyink (Canon) on Sep 04, 2014 at 16:38 UTC | |
by karlgoethebier (Abbot) on Sep 04, 2014 at 18:09 UTC | |
by Jenda (Abbot) on Sep 05, 2014 at 15:43 UTC |