in reply to XML::Twig - how can I test for an attribute when the attribute value is 0?
#!/usr/bin/perl -l BEGIN { $| = 1; $^W = 1; } use strict; use autodie; use warnings; use XML::Twig; my $elt =XML::Twig->new( start_tag_handlers => { _all_ => sub { print join( ' - ' => values %{ $_->atts } ); } })->parse( \*DATA ); __DATA__ <doc> <elt att="not rare">fq0</elt> <elt att="not rare">fq1</elt> <elt att="rare">fq2</elt> </doc>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: XML::Twig - how can I test for an attribute when the attribute value is 0?
by Anonymous Monk on Aug 30, 2012 at 03:10 UTC | |
by Anonymous Monk on Aug 30, 2012 at 03:58 UTC | |
by Anonymous Monk on Aug 30, 2012 at 07:06 UTC |