Вот мой измененный входной XML:
<Input>
<BIKey></BIKey>
<BusinessObjects>
<BusinessObject>
<BusinessIdentifiers>
<BusinessIdentifier>
<BKey>BuCode</BKey>
<BValue>CDC</BValue>
</BusinessIdentifier>
<BusinessIdentifier>
<BKey>BuType</BKey>
<BValue>123</BValue>
</BusinessIdentifier>
<BusinessIdentifier>
<BKey>CsmNo</BKey>
<BValue>857895</BValue>
</BusinessIdentifier>
</BusinessIdentifiers>
<BusinessAttributes>
<BusinessAttribute>
<BKey>Version</BKey>
<BValue>1</BValue>
</BusinessAttribute>
<BusinessAttribute>
<BKey>date</BKey>
<BValue>2018-06-28</BValue>
</BusinessAttribute>
</BusinessAttributes>
</BusinessObject>
<BusinessObject>
<BusinessIdentifiers>
<BusinessIdentifier>
<BKey>BuCode</BKey>
<BValue>CDC</BValue>
</BusinessIdentifier>
<BusinessIdentifier>
<BKey>BuType</BKey>
<BValue>123</BValue>
</BusinessIdentifier>
<BusinessIdentifier>
<BKey>CsmNo</BKey>
<BValue>34567</BValue>
</BusinessIdentifier>
</BusinessIdentifiers>
<BusinessAttributes>
<BusinessAttribute>
<BKey>Version</BKey>
<BValue>1</BValue>
</BusinessAttribute>
<BusinessAttribute>
<BKey>date</BKey>
<BValue>2018-06-28</BValue>
</BusinessAttribute>
</BusinessAttributes>
</BusinessObject>
</BusinessObjects>
</Input>
Я хотел бы получить следующий вывод CDC|123|857895:CDC|123|34567
, присвоенный <BIKey>
.
Я пробовал этот Xquery:
<Input>
<BIKey>{ string-join(data($Input/BusinessIdentifiers/BusinessIdentifier/BValue),'|') }</BIKey>
</Input>
Но я получил этот вывод CDC|123|857895|CDC|123|34567
.
Как я могу это исправить?