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 ให้สมบูรณ์