Not possible in XPath (at least not in XPath 1.0, which I suppose is the version you have).
Using XSLT, this will be easy:
<xsl:template match="/data"> <xsl:apply-templates select="row" /> </xsl:template> <xsl:template match="row"> <xsl:value-of select="@val" /> <xsl:if test="position() < last()"> <xsl:text>;</xsl:text> </xsl:if> </xsl:template>
XPath is a choice language, not a processing language. You can process nodes in any other programming language that provides XML and XPath support. XSLT is just one option.
Tomalak
source share