XSLT <xsl:kopiuj>
❮ Pełne odniesienie do elementu XSLT
Definicja i użycie
Element <xsl:copy> tworzy kopię bieżącego węzła.
Uwaga: Węzły przestrzeni nazw bieżącego węzła są również automatycznie kopiowane, ale węzły podrzędne i atrybuty bieżącego węzła nie są automatycznie kopiowane!
Składnia
<xsl:copy use-attribute-sets="name-list">
<!-- Content:template -->
</xsl:copy>
Atrybuty
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 |
Przykład 1
Skopiuj węzeł wiadomości do dokumentu wyjściowego:
<?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>
❮ Pełne odniesienie do elementu XSLT