以下数据需要连接。但是我收到的XML文档可以有“零到n”b元素。换句话说,如果有否b元素的XSLT应该仍然工作正常例如:使用模板将元素的值连接到变量?
<a>
<b1>Some</b2>
<b2>data</b2>
<b3>what</b3>
<b4>need</b4>
<b5>to</b5>
<b6>be</b6>
<b7>concatenated</b7>
</a>
预期结果
<a>
<b1>Some data what need to be concatenated</b1>
</a>
我尝试下面的结构,但我不能使它工作。
<xsl:variable name="details" select="//b*"/>
<xsl:for-each select="$details">
<!-- how can I concatenate the values of the b's to a variable????-->
</xsl:for-each>
<!-- Process the variable for further needs-->
我希望有些身体可以给我一个提示吗? 关注Dirk
的示例数据没有出来throught。一些 数据 什么 需要 到 是 再次连接起来 –
Dirk