porton
porton

Reputation: 5805

How to strip leading and trailing spaces of a string in XSLT 2.0?

How to strip leading and trailing spaces of a string in XSLT 2.0 (with XPath, thus).

fn:normalize-space is not a solution because it also collapses spaces inside.

Upvotes: 0

Views: 429

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167696

Use replace: replace(' a ', '^\s+|\s+$', '').

Upvotes: 3

Related Questions