Rich Ashworth
Rich Ashworth

Reputation: 2015

How can I extract a string within square brackets in xslt

Given a string such as "Hello [world]", how would I get the value of the text inside the square brackets with xslt?

Upvotes: 1

Views: 844

Answers (1)

Linga Murthy C S
Linga Murthy C S

Reputation: 5432

substring-before(substring-after(root, '['),']')

Where "root" is the node having your string.

Upvotes: 2

Related Questions