1

How to combine values (strings) in XPath? Say we've got something like this:

<entry>
  <x>value1</x>
  <y>value2</y>
</entry>

How would I accomplish entry/value1 + entry/value2 I'm looking for the substitue of this in PHP:

$result = $value1 . $value2

Also, is it possible to combine with a predefined string that's not from the XML? Like:

$result = 'prefix' . $value1

Any help would be greatly appreciated.

1 Answer 1

1

XPath's concat function may prove useful: concat('prefix',/entry/x,/entry/y)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.