XPath to return string concatenation of qualifying child node values

前端 未结 7 1627
太阳男子
太阳男子 2020-11-29 07:44

Can anyone please suggest an XPath expression format that returns a string value containing the concatenated values of certain qualifying child nodes of an element, but igno

7条回答
  •  有刺的猬
    2020-11-29 07:54

    In XPath 1.0:

    You can use

    /div//text()[not(parent::p)]
    

    to capture the wanted text nodes. The concatenation itself cannot be done in XPath 1.0, I recommend doing it in the host application.

提交回复
热议问题