XSLT <xsl:copy>
❮ Vollständige XSLT-Elementreferenz
Definition und Verwendung
Das Element <xsl:copy> erstellt eine Kopie des aktuellen Knotens.
Hinweis: Namensraumknoten des aktuellen Knotens werden automatisch mitkopiert, aber Kindknoten und Attribute des aktuellen Knotens werden nicht automatisch kopiert!
Syntax
<xsl:copy use-attribute-sets="name-list">
<!-- Content:template -->
</xsl:copy>
Attribute
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 |
Beispiel 1
Kopieren Sie den Nachrichtenknoten in das Ausgabedokument:
<?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>
❮ Vollständige XSLT-Elementreferenz