我的問題是關於如何在不同的循環中增加屬性id,但id必須在XSLT中是唯一的?在不同循環中增加一個屬性id,但id必須在XSLT中是唯一的
0
A
回答
0
對於當前的需求,你可以處理這只是這樣
<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>
相關問題
- 1. ID自動增加但不是唯一
- 2. 究竟是不是唯一的ID的可能性在一個循環中
- 3. XML中的ID屬性必須唯一嗎?
- 4. ID在整個頁面中必須是唯一的嗎?
- 5. 在while循環中給出唯一ID
- 6. 你的內容必須有一個listview,其id屬性是'android.r.id.list'
- 7. 您的內容必須有一個ListView,其id屬性是android.R.id.list
- 8. 使用唯一ID循環?
- 9. 內容必須有一個ListView,其id屬性是
- 10. 是否一個ID POCO屬性必須案例RavenDB敏感?
- 11. HTTPGET屬性必須爲一個方法,但不是另一個
- 12. 做一個框架中的文檔的元素ID必須是唯一的
- 13. `id`屬性在iframe中需要是唯一的嗎?
- 14. 在循環中生成一個Javascript id
- 15. 如何在mongodb中增加一個id
- 16. 錯誤:內容必須有一個ListView的id屬性android.R.id.list
- 17. 您的內容必須有一個TabHost其id屬性爲 'android.R.id.tabhost'
- 18. 帶有重複ID的組合必須在sql中是唯一的
- 19. 從多個唯一ID獲取屬性
- 20. 是羣組的唯一ID在多個域中保持唯一
- 21. 在一個循環中設置多個不同JButton的屬性
- 22. 內容必須有一個ListView其id屬性爲 'android.R.id.list'
- 23. 插入數據「MobileServiceTable必須定義一個id屬性」
- 24. 內容必須有一個ListView其id屬性爲 'android.R.id.list'
- 25. VBA - 循環將不會被一個在ID列,每次遞增
- 26. JSF2:ui:include:組件ID必須是唯一的
- 27. 它需要一個slugfield在django中必須是唯一的嗎?
- 28. 替換循環中的id屬性
- 29. 在HTML中使ID唯一
- 30. 如何在一個drupal塊中的polldaddy中添加唯一ID?
哪裏是你的XSLT?什麼問題你完全面對。 – Rupesh
的 <的xsl:for-每個選擇= 「PFA /記錄/人」> 的 XSL:換各> <的xsl:for-每個選擇= 「PFA /記錄/實體」> 的 的xsl:for-each>的 XSL:模板> –
我需要在2個循環之間以全局方式遞增ID @Rupesh –