XSLT <xsl:속성>
❮ 완전한 XSLT 요소 참조
정의 및 사용
<xsl:attribute> 요소는 요소에 속성을 추가하는 데 사용됩니다.
참고: <xsl:attribute> 요소는 기존 속성을 동일한 이름으로 바꿉니다.
통사론
<xsl:attribute name="attributename" namespace="uri">
<!-- Content:template -->
</xsl:attribute>
속성
Attribute | Value | Description |
---|---|---|
name | attributename | Required. Specifies the name of the attribute |
namespace | URI | Optional. Defines the namespace URI for the attribute |
실시예 1
그림 요소에 소스 속성 추가:
<picture>
<xsl:attribute name="source"/>
</picture>
실시예 2
그림 요소에 소스 속성을 추가하고 "이미지/이름"의 값으로 채웁니다.
<picture>
<xsl:attribute name="source">
<xsl:value-of select="images/name" />
</xsl:attribute>
</picture>
실시예 3
모든 출력 요소에 적용할 수 있는 속성 집합을 만듭니다.
<xsl:attribute-set name="font">
<xsl:attribute name="fname">Arial</xsl:attribute>
<xsl:attribute name="size">14px</xsl:attribute>
<xsl:attribute name="color">red</xsl:attribute>
</xsl:attribute-set>
❮ 완전한 XSLT 요소 참조