http://qs321.pair.com?node_id=827001


in reply to Re: XML::twig counting elements that don't have a certain attribute/value on them
in thread XML::twig counting elements that don't have a certain attribute/value on them

Toolic

I have modified your suggestion (I needed the ones that weren't suppressed) as this seemed to cope with the added requirements for testing for other attributes and values. Thansk for this suggestion

My code is something like this:

my $numOfQuots = 0; if ( my @qps = $elt->children('qp') ) { foreach my $qp (@qps) { foreach my $q ($qp->children( qr/^(q|xr)$/ ) ) { $numOfQuots++ if (($q->att('supp') ne 'yes') && ($q->att('info') ne 'yes') && ($q->att('info') ne 'info') && ($q->att('info') ne 'intro') && ($q->att('style') ne 'IMPL')); } } }