XPath to count the child nodes based on complex filter

前端 未结 2 1336
南旧
南旧 2021-01-05 04:21

I have an XML in the following format:


  
    
        

        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 05:07

    @Bala-R (+1) is correctly evaluated using a compliant XSLT 1.0 processor (Saxon):

    count(//ComRequest/root/component[count(compLine)>10])
    

    or, either

    count(/*/*/*[count(compLine)>10])
    

    Otherwise something is going bad in your tests, your context (different from the one provided in the question) or your xpath evaluator.

提交回复
热议问题