XSLT <xsl:include> 요소
정의와 사용법
<xsl:include> 요소는 최상위 요소(top-level element)로, 하나의 스타일시트에서 다른 스타일시트의 스타일을 포함합니다.
주의사항:포함된 스타일시트(included style sheet)는 포함된 스타일시트(including style sheet)와 동일한 우선순위를 가집니다.
주의사항:이 요소는 <xsl:stylesheet> 또는 <xsl:transform>의 자식 요소여야 합니다.
문법
<xsl:include href="URI"/>
속성
| 속성 | 값 | 설명 |
|---|---|---|
| href | URI | 必需. 포함될 스타일시트의 URI를 정의합니다. |
예시
예제 1
아래의 예제는 xslincludefile.xsl이라는 스타일시트를 포함하고 있습니다:
<?xml 버전=1.0'?>
<xsl:stylesheet 버전="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output 방법="xml" omit-xml-declaration="yes"/>
<xsl:template 매치="/">
<xsl:for-each select="COLLECTION/BOOK">
<xsl:apply-templates select="TITLE"/>
<xsl:apply-templates select="AUTHOR"/>
<xsl:apply-templates select="PUBLISHER"/>
<BR/> <!-- add this -->
</xsl:for-each>
</xsl:template>
<xsl:template 매치="TITLE">
<DIV 스타일="color:blue">
제목: <xsl:value-of select="."/>
</DIV>
</xsl:template>
<xsl:include href="/xsl/xslincludefile.xsl" />
</xsl:stylesheet>

