XSLT <xsl:copy> 요소

정의와 사용법

<xsl:copy> 요소는 현재 노드의 복사본(拷貝)을 생성할 수 있습니다.

주석:현재 노드의 Namespace 노드는 자동으로 복사됩니다. 그러나 현재 노드의 자식 노드와 속성은 자동으로 복사되지 않습니다!

문법

<xsl:copy use-attribute-sets="name-list">
  <!-- Content:template -->
</xsl:copy>

속성

속성 설명
use-attribute-sets name-list 선택 사항입니다. 이 점이 요소인 경우, 이 속성은 출력 점에 적용되는 속성 집합 목록으로, 공백으로 구분됩니다.

예제

예제 1

message 점을 출력 문서에 복사합니다:

<?xml version="1.0" encoding="ISO-8859-1"?>
<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>