我有一个像这样的xml,
<Accounts>
<Account>
<AccNo>
<Acc1>1</Acc1>
<Acc2>2</Acc2>
</AccNo>
<AccItem>
<AccItemDetail>Item1</AccItemDetail>
</AccItem>
</Account>
<Account>
<AccNo>
<Acc1>3</Acc1>
<Acc2>4</Acc2>
</AccNo>
<RefAcc>
<AccNo>
<Acc1>1</Acc1>
<Acc2>2</Acc2>
</AccNo>
</RefAcc>
<AccItem>
<AccItemDetail>Item2</AccItemDetail>
</AccItem>
</Account>
<Account>
<AccNo>
<Acc1>5</Acc1>
<Acc2>6</Acc2>
</AccNo>
<AccItem>
<AccItemDetail>Item3</AccItemDetail>
</AccItem>
</Account>
</Accounts>
&#13;
现在,如果RefAcc存在,我想通过concat(AccNo / Acc1,AccNo / Acc2)加concat(RefAcc / AccNo / Acc1,RefAcc / AccNo / Acc1)对所有帐户进行分组。所以在上面的xml中,前两个<Account>
将被组合在一起,而AccItem将同时具有Item1和Item2,即得到的xml将是
<Accounts>
<Account>
<AccNo>12</AccNo>
<AccItem>
<AccItemDetail>Item1</AccItemDetail>
</AccItem>
<AccItem>
<AccItemDetail>Item2</AccItemDetail>
</AccItem>
</Account>
<Account>
<AccNo>56</AccNo>
<AccItem>
<AccItemDetail>Item3</AccItemDetail>
</AccItem>
</Account>
</Accounts>
&#13;
如果有多个<Account>
,如何以高效的方式在XSLT 2.0中实现这一目标?