Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Append literal string (plain text) to XPath result

Is there a way to append a literal string to whatever an XPath expression gets you?

e.g. from following XML:

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

I would like to produce:

I am a literal

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

like image 619
MarioDS Avatar asked Jun 17 '14 15:06

MarioDS


1 Answers

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

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

like image 90
user3745903 Avatar answered Oct 13 '22 11:10

user3745903