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