0

I don't know a lot about xslt but I need to fix a bug in someone else's code. The issue is that some data is not being outputted correctly in an XML file so I need to use an XSLT to move the data to the correct node. An example is shown below:

Incorrect XML:

<record name="recordname" value="Text(AAxxxx)">
<field name="recordID" value=""/>
</record>

Correct XML:

<record name="recordname" value="Text(AAxxxx)">
    <field name="recordID" value="Text(AAxxxx)"/> 
    </record>

So I need to copy the value of the value field from the record name node to value in the field name node. Can anyone help me with this?

Thanks in advance

4

1 回答 1

1

在 XSLT 中提取“值”是:

<xsl:value-of select="record/field/@value" />

提取属性是元素后的“@”。

这是一种可能。

于 2013-06-13T18:45:33.430 回答