开发者

xpath: how to select all text nodes that precedes or follows <br> tags ? possible for \n?

开发者 https://www.devze.com 2023-01-24 22:40 出处:网络
text<br> text2<br> text3<br/> br tags may be self closing or not. would it be possible for a regular text:
text<br>
text2<br>
text3<br/>

br tags may be self closing or not.

would it be possible for a regular text:

开发者_如何学Ctext\n
text2\n
text3\n


you can give:

//br/preceding-sibling::*/text()

where //br will select all the breaks in the document

0

精彩评论

暂无评论...
验证码 换一张
取 消