XPath to return string concatenation of qualifying child node values

前端 未结 7 1700
太阳男子
太阳男子 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:53

    If you want all children except p, you can try the following...

        string-join(//*[name() != 'p']/text(), "")
    

    which returns...

    This text node should be returned.
    And the value of this element.
    And this.
    

提交回复
热议问题