Matching a node based on a sibling's value with XPath

前端 未结 3 1697
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 18:29

Having a XML document like this:



  
             


        
3条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 19:12

    Surprisingly, none of the answers to date on this old question provide the simplest XPath solution.

    This simple XPath

    /records/record[record-type = "A"]/name
    

    selects

    svn
    blog
    

    as requested.

提交回复
热议问题