我的XSLT中的每个部分都有:
<xsl:for-each select="Engineers/Value">
<wor1:Engineer><xsl:value-of select="Name"/>;</wor1:Engineer>
</xsl:for-each>
我的输出是这样的(如果结果返回3个元素)
<wor1:Engineer>John;</wor1:Engineer>
<wor1:Engineer>Susan;</wor1:Engineer>
<wor1:Engineer>Bob;</wor1:Engineer>
但我希望这样的结果只有一行:
<wor1:Engineer>John;Susan;Bob;</wor1:Engineer>
这可能吗?
答案 0 :(得分:3)
<wor1:Engineer>
<xsl:for-each select="Engineers/Value">
<xsl:value-of select="Name"/>
<xsl:text>;</xsl:text>
</xsl:for-each>
</wor1:Engineer>
答案 1 :(得分:0)
或者在XSLT 3.0中
<wor1:Engineer>{Engineers/Value!(Name||';')}</wor1:Engineer>