@LingamurthyCSは述べているように、アイデンティティは、以下に示すような各種のXPath 試合参照を持つ<item>
ノードの名前を変更するトランスフォームとテンプレートを検討:
結果参照し、子供に適用-テンプレート付き要素:
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output version="1.0" encoding="UTF-8" indent="yes" method="xml"/>
<xsl:strip-space elements="*"/>
<!-- Identity Transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="result/*">
<item>
<xsl:apply-templates select="*"/>
</item>
</xsl:template>
</xsl:transform>
項目参照して
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output version="1.0" encoding="UTF-8" indent="yes" method="xml"/>
<xsl:strip-space elements="*"/>
<!-- Identity Transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/*/*">
<item>
<xsl:copy-of select="*"/>
</item>
</xsl:template>
</xsl:transform>
:参照とコピーの子要素のSULT
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output version="1.0" encoding="UTF-8" indent="yes" method="xml"/>
<xsl:strip-space elements="*"/>
<!-- Identity Transform -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[contains(name(), 'item')]">
<item>
<xsl:apply-templates />
</item>
</xsl:template>
</xsl:transform>
は、[例](http://stackoverflow.com/、テンプレートを変換するIDを使用しますa/8679861/3244046)、すべてのノードをそのままコピーする。 '/ result/* 'にマッチする別のテンプレート、つまり' result'の子要素を追加し、必要に応じてそれらを変換します。 –