から2つのノードを作る:私は上記のすべてのノードをコピーするだけでなく、一定の値を持つノードのいくつかの追加のコピーを作成する必要がXSLTコピー - 私は、次のXML持つ1つのノード
<records>
<record>
<id>111</id>
<amount>123.45</amount>
<taxCode>A</taxCode>
</record>
</records>
をtaxCodeのことです。 は、どのように私は次のようachiveになります。これですべてのヘルプは高く評価され
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"
encoding="UTF-8"
omit-xml-declaration="no"
indent="yes" />
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="records/taxCode[text() = 'A']" >
<xsl:copy select="node()" />
</xsl:template>
</xsl:stylesheet>
:
<records>
<record>
<id>111</id>
<amount>123.45</amount>
<taxCode>A</taxCode>
</record>
<!-- copy of the node above with amount and taxCode changed -->
<record>
<id>111</id>
<amount>-123.45</amount>
<taxCode>B</taxCode>
</record>
</records>
私は次のような単純なXSLしかし、一度そのちょうどコピーのすべてを使用してみました。