たとえば、次の XML を指定します。
<root>
<item>
<id>111</id>
<description>aisle 12, shelf 3</description>
<description>inside the box</description>
</item>
</root>
結果が欲しい:
<root>
<item>
<id>111</id>
<description>aisle 12, shelf 3 inside the box</description>
</item>
</root>
ただし、ノードには任意の名前を付けることができ、任意のレベルにある可能性があります。タグが繰り返される限り、同じクエリが異なる XML で機能することを望みます。
<root>
<item>
<id>112</id>
<attributes>
<author>Joe Smith</author>
<author>Arthur Clarke</author>
<author>Jeremiah Wright</author>
</attributes>
</item>
</root>
出力:
<root>
<item>
<id>112</id>
<attributes>
<author>Joe Smith Arthur Clarke Jeremiah Wright</author>
</attributes>
</item>
</root>
これは BaseX で可能ですか? そうでない場合、既知の要素 (たとえば、/root/item/attributes/author のみ) を指定してこれを行うことはできますか?