|P is for Practical|
Counting number of child nodes based on element valueby madbee (Acolyte)
|on Jul 05, 2013 at 06:58 UTC||Need Help??|
madbee has asked for the
wisdom of the Perl Monks concerning the following question:
Hello!This is in reference to: Title:XML parsing and Lists
I need to get the count of LI elements where H4 = "include". The document I am working with can have multiple Sections and headers. But only for Header = "Include", I need to get the total count of LI elements only.
From the referenced link, I understand we can do this using XpathContext: xdom->find(count(path));.
However, I am not sure how I could filter it by the value of the Header element. Is it possible in 1 XPath expression? If so, can someone please give an example of how this can be done or point me to an example where this has been done already?
Thanks so much in advance.