如何编写一些XQuery来解决以下问题:
这是我目前写的:
<friends>
{for $lastname in volunteerDatabase/person/name/lastname
return
concat($lastname/string(), ' +')}
</friends>
此查询返回:
<Friends>Geller + Bing + Tribbiani +</Friends>
我想返回以下内容,其中所有值都用“+”分隔:
<Friends>Geller + Bing + Tribbiani</Friends>
虚拟数据示例:
<?xml version="1.0" encoding="UTF-8" ?>
<volunteerDatabase>
<person age="31" ssn="046187254">
<name>
<firstname>Ross</firstname>
<lastname>Geller</lastname>
</name>
<telephone type="landline">
<number>5534567</number>
</telephone>
<telephone type="mobile">
<number>0851234567</number>
</telephone>
</person>
<person age="29" ssn="355817204">
<name>
<firstname>Chandler</firstname>
<firstname>Muriel</firstname>
<lastname>Bing</lastname>
</name>
<telephone type="mobile">
<number>0869932617</number>
</telephone>
</person>
<person ssn="778123666">
<name>
<firstname>Joseph</firstname>
<firstname>Francis</firstname>
<lastname>Tribbiani</lastname>
</name>
<telephone type="landline">
<number>01628777</number>
</telephone>
</person>
</volunteerDatabase>
感谢您的指导。