Concatenate multiple node values in xpath
I used concat method and works well.
concat(//SomeElement/text(),'_',//OtherElement/text())
Try this expression...
string-join(//element3/(concat(element4/text(), '.', element5/text())), " ")
for $d in $doc/element2/element3
return fn:string-join(fn:data($d/element()), ".")
.
$doc stores the Xml.
Here comes a solution with XSLT
:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="//element3">
<xsl:value-of select="element4/text()" />.<xsl:value-of select="element5/text()" />
</xsl:template>
</xsl:stylesheet>