S
S
Shimpanze2019-07-23 17:28:03
XPath
Shimpanze, 2019-07-23 17:28:03

How to return a string without spaces around the edges?

Hello!
How to return the first text node of its parent without whitespace around the edges?
Node: XPath query: ...returns: "Hello " (with a space at the end). Is it possible, with just one XPath , to return strings without spaces "Hello"? Thank you!
<p>Hello <b>World</b> by.</p>
p/text()[normalize-space(.)][1]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fov, 2019-07-24
@Roman-Fov

p/normalize-space(text()[1])
It?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question