0
我需要用地址線1更新地址,並將裏面的值更新爲1個簡單的地方並將其保存在一個變量中。輸入任何虛擬XML更新屬性名稱和元素值
使用這個樣式表
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:template match="/">
<xsl:variable name="request">
<customers>
<customer name="Address">1 Doe Place</customer>
<customer name="State">OH</customer>
<customer name="Name">John</customer>
<customer name="Name">Kevin</customer>
<customer name="Name">Leon</customer>
<customer name="Name">Adam</customer>
<customer name="city">Columbus</customer>
</customers>
</xsl:variable>
<xsl:variable name="response">
-------
</xsl:variable>
<xsl:copy-of select="$response"/>
</xsl:template>
</xsl:stylesheet>
不知道究竟是什麼在這裏更新。我知道如何與身份做變換,但在這裏我很困惑
爲什麼你哈在樣式表中編碼數據,而不是使用外部查找XML文檔 - 當地址(或任何其他項目)更改時,您可以簡單地更新它? – 2014-12-02 03:56:27
其實我正在讀一個來自早期調用的變量。然後我需要更新它 – mnvbrtn 2014-12-02 04:03:36
更新來自哪裏?此外,描述「*來自早期調用的變量*」並不清楚。這在XSLT 1.0中至關重要,因爲變量可能包含節點集或結果樹片段。 – 2014-12-02 04:17:42