在不同循环中增加一个属性id,但id必须在XSLT中是唯一的
答
对于当前的需求,你可以处理这只是这样
<xsl:template match="Records">
<xsl:for-each select="//Person|//Entity">
<Entity>
<xsl:attribute name="ID" select="position()"/>
<xsl:choose>
<xsl:when test="self::Person">
<Type>Individual</Type>
<Gender>Male</Gender>
<xsl:copy-of select="descendant::FirstName"/>
</xsl:when>
<xsl:otherwise>
<Type>Business</Type>
<Full_Name><xsl:value-of select="descendant::EntityName"/></Full_Name>
</xsl:otherwise>
</xsl:choose>
</Entity>
</xsl:for-each>
</xsl:template>
哪里是你的XSLT?什么问题你完全面对。 – Rupesh
的 的 XSL:换各> 的 的xsl:for-each>的 XSL:模板> –
我需要在2个循环之间以全局方式递增ID @Rupesh –