I have the following XML structure:
<list>
<value>
<firstname>mark1</firstname>
<address>my address</address>
<city>bruxelles</city>
<id>1</id>
<lastname>durand</lastname>
</value>
<value>
<firstname>mark2</firstname>
<address>my address</address>
<city>bruxelles</city>
<id>2</id>
<lastname>durand</lastname>
</value>
<value>
<firstname>mark3</firstname>
<address>my address</address>
<city>bruxelles</city>
<id>3</id>
<lastname>durand</lastname>
</value>
</list>
When I do /list/value/firstname/text()
, I have:
mark1
mark2
mark3
As I would like to have something like
1 - mark1
2 - mark2
3 - mark3
I tried: concat(/list/value/id/text(),"-", /list/value/firstname/text())
But it would only return the first set, i.e.
1-mark1
Is there a way to achieve what I'm looking for and loop over the nodes?