XPath function
concat()
Joins two or more strings. There is no + for strings in XPath.
concat() takes two or more arguments and returns them joined. It is the only string join in XPath 1.0 — the + operator is arithmetic and will try to convert its operands to numbers.
Node-set arguments are converted to their string-value first, which means only the first node of each is used.
- Syntax
concat(string, string, string*) → string- Returns
- string
- Kind
- Function
- Version
- XPath 1.0 (libxml2)
The sample documents
Every example on this page runs against this document. The sitemap one is namespaced on purpose — almost every real XML document is, and that changes which expressions match.
<?xml version="1.0" encoding="UTF-8"?>
<order id="A-1001" tier="gold">
<customer country="NO">Ada Lovelace</customer>
<lines>
<line sku="WIDGET-1" qty="2"><price>14.50</price></line>
<line sku="WIDGET-2" qty="1"><price>39.00</price></line>
<line sku="GIFT-WRAP" qty="1"><price>0.00</price></line>
</lines>
<note> Deliver after 09:00 </note>
</order>Related
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.