I am using XML::Twig to parse my input xml using Perl.
I need to extact a particular node in this XML and validate that node to see if it has multiple <p> tags and then count words in those P tags.
For example:
<XML>
<name>
</name>
<address>
<p id="1">a b c d </p>
<p id="2">y y y </p>
</address>
</XML>
Output:
Address has 2 paragraph tags with 7
words.
Any suggestions?
Here is one way to do it:
XML::Twig has a dedicated website with documentation and a Tutorial to describe the handler technique used above.