[英]How to grab a value from one xml to another using xslt variable and value of?
[英]How to derieve value from intermediate XML variable using XSLT ?
XSLT:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="A" select="$B" /> <!-- B is derived and has xml strucure -->
<!-- how to derive value of elent D here ???? -->
<xsl:variable name="varD" select="$B/B/C/D" />
</xsl:stylesheet>
XML:
<B>
<C>
<D>xxxx</D>
</C>
</B>
如何從變量A得出變量D的值?
如果您顯示更多代碼,這確實會有所幫助,以便我們可以了解真正的問題,但是我懷疑您遇到了XSLT 1.0中的“結果樹片段”問題。
解決方案是使用exslt:node-set()擴展功能將結果樹片段變量轉換為節點集,或者移至XSLT 2.0,從而消除了此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.