Hello!This is in reference to: Title:XML parsing and Lists
For the below xml file: <Aritcle> <Main> <Sect> <H4>Include</H4> ..... <P1> This is the criteria</P1> <L> <LI> <LI_Label>1.</LI_Label> <LI_Title>Critera 1</LI_Title> </LI> <LI> <LI_Label>2.</LI_Label> <LI_Title>Critera 2</LI_Title> </LI> <LI> <LI_Label>3.</LI_Label> <LI_Title>Critera 3</LI_Title> </LI> <LI> <LI_Label>4.</LI_Label> <LI_Title>Critera 3</LI_Title> </LI> </Sect> </Main> </Article>
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.
madbee
In reply to Counting number of child nodes based on element value by madbee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |