XSLT <xsl:copy>
❮完全なXSLT要素リファレンス
定義と使用法
<xsl:copy>要素は、現在のノードのコピーを作成します。
注:現在のノードの名前空間ノードも自動的にコピーされますが、子ノードと現在のノードの属性は自動的にコピーされません。
構文
<xsl:copy use-attribute-sets="name-list">
<!-- Content:template -->
</xsl:copy>
属性
Attribute | Value | Description |
---|---|---|
use-attribute-sets | name-list | Optional. A white space separated list of attribute-sets to apply to the output node, if the node is an element |
例1
メッセージノードを出力ドキュメントにコピーします。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="message">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
❮完全なXSLT要素リファレンス