mertserger has asked for the wisdom of the Perl Monks concerning the following question:
However what is really wanted is a count of quotations which are not suppressed, which is indicated by the q tag having an attribut supp='yes' on it. As I am fairly new to using XML::twig I am not sure how to rewrite the code above so that the count is of q elements without the supp attribute or where the supp attribute is not equal to 'yes'.if ( my @qps = $elt->children('qp') ) { foreach my $qp (@qps) { $numOfQuots = $numOfQuots + scalar( $qp->children( qr/ +^(q|xr)$/) ); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::twig counting elements that don't have a certain attribute/value on them
by toolic (Bishop) on Feb 10, 2010 at 16:15 UTC | |
by mertserger (Curate) on Mar 05, 2010 at 15:47 UTC | |
|
Re: XML::twig counting elements that don't have a certain attribute/value on them
by mirod (Canon) on Feb 10, 2010 at 16:13 UTC | |
by mertserger (Curate) on Feb 11, 2010 at 15:09 UTC | |
by mirod (Canon) on Feb 12, 2010 at 05:20 UTC | |
by mertserger (Curate) on Mar 05, 2010 at 11:43 UTC | |
|
Re: XML::twig counting elements that don't have a certain attribute/value on them
by Jenda (Abbot) on Feb 12, 2010 at 10:02 UTC |