Add literal string (plain text) to XPath result

Is there a way to add a literal string to any XPath expression?

eg. from the following XML:

<root> <select>I am</select> </root> 

I would like to create:

I literally

purely with XPath. What can I add to /root/select to get what I want? Important: XPath 1.0 solution required! I do not use XSLT.

+7
string text xpath literals
source share
1 answer

Any reason you can't just concat () 'literal' to the end?

Something like: concat( string(/some/selector) , ' some literal' ) ?

+6
source share

All Articles