Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: XML::twig counting elements that don't have a certain attribute/value on them

by mertserger (Curate)
on Mar 05, 2010 at 15:47 UTC ( #827001=note: print w/replies, xml ) Need Help??


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')); } } }

  • Comment on Re^2: XML::twig counting elements that don't have a certain attribute/value on them
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://827001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2022-05-21 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (78 votes). Check out past polls.

    Notices?