KJW
KJW

Reputation: 15251

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

text<br>
text2<br>
text3<br/>

br tags may be self closing or not.

would it be possible for a regular text:

text\n
text2\n
text3\n

Upvotes: 1

Views: 1086

Answers (1)

prabakaran
prabakaran

Reputation: 86

you can give:

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

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

Upvotes: 3

Related Questions