SLCH000
SLCH000

Reputation: 2233

Take substring of text of node using only xPath

Input node something like:

<span>   01.02.2019 - 31.12.2099      <span>

I want to get 01.02.2019 (with whitespaces left or not).

xPath 1.0 only

Upvotes: 0

Views: 62

Answers (1)

zx485
zx485

Reputation: 29052

After fixing the closing tag, try this expression

normalize-space(substring-before(span,'-'))

Upvotes: 1

Related Questions