我知道如果我有非唯一的子节点(通过“concat”)的话,我的问题将很容易得到解决。
问题:
<CarPlant> <Model>Audi</Model> <Model>Scoda</Model> </CarPlant>
我想得到一个字符串,例如“Audi,Scoda”,用scala的方法处理它。
XPath 2.0表达式,
/CarPlant/string-join(Model,',')
将评估为
Audi,Scoda
按要求为您的XML。