以下數據需要連接。但是我收到的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