我正在使用下面的方法將值賦給變量。解除後分配給<xsl:variable>
<xsl:variable name="NewValue">
<xsl:value-of select="normalize-space(//root/id/amount)"/>
</xsl:variable>
賦值後我想給新的值賦給同一個變量。像這樣: -
<xsl:variable name="NewValue" select="normalize-space(//root/id/amountnew)">
有沒有什麼辦法呢?
這裏XML的樣品,我有:
<VolLien>
<Vest_DocType>SDD</Vest_DocType>
<Vest_Instrument>395072</Vest_Instrument>
<Vest_OfOfficialEntity>eee</Vest_OfOfficialEntity>
<Vest_RecDate>12/24/2009</Vest_RecDate>
<Vest_Grantee1>abc dd</Vest_Grantee1>
<Vest_Grantor1>sss</Vest_Grantor1>
<Vest_RejectCode />
<Vest_RejectReason />
<Vest_ImageNum> </Vest_ImageNum>
</VolLien>
我的問題是我需要獲得最新的特別<Vest_DocType>
(說SDD)<Vest_RecDate>
然後我需要在整個XML任何日期搜索這在此(相同的SDD)的<Vest_RecDate>
之前。
如果再單獨提出該特定部分(<VolLien>
)並再次提出最新。如果我可以重新分配,我會定位節點並獲取與之相關的值。現在我正在使用另一個循環來做這件事。如果有東西在那裏,我可以避免extrs循環。
請添加您正在使用的XML的示例,以及您要做什麼的簡短描述。 – Tomalak 2012-03-08 06:40:58
嗨,我正在做一些規則操縱xsl與我的XML數據。對於某個場景,我想重新分配已經聲明的變量的另一個值。這是我尋找這樣的任何選項的原因,,無論如何謝謝你爲我快速回復和有價值的輸入 – Varun 2012-03-08 07:02:20
@Varun我沒有完全理解你的要求,但看看我的修改答案,也許這會讓你開始。 *(PS:您可以移除評論,因爲我將它們移到問題中。)* – Tomalak 2012-03-08 15:57:20