XSLT <xsl:include> 요소
정의와 사용법
<xsl:include> 요소는 최상위 요소(top-level element)로, 한 스타일 시트의 스타일 시트 내용을 다른 스타일 시트에 포함합니다.
주의:포함된 스타일 시트(포함된 스타일 시트)는 포함된 스타일 시트(포함된 스타일 시트)와 동일한 우선순위를 가집니다.
주의:이 요소는 <xsl:stylesheet> 또는 <xsl:transform>의 자식 요소여야 합니다.
문법
<xsl:include href="URI"/>
속성
속성 | 값 | 설명 |
---|---|---|
href | URI | 必需. 포함할 스타일 시트의 URI를 지정합니다. |
예시
예제 1
이 예제는 xslincludefile.xsl 이름의 스타일 시트를 포함하고 있습니다:
<?xml version=1.0'?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:template match="/"> <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 match="TITLE"> <DIV STYLE="color:blue"> 제목: <xsl:value-of select="."/> </DIV> </xsl:template> <xsl:include href="/xsl/xslincludefile.xsl" /> </xsl:stylesheet>