องค์ประกอบ <xsl:attribute-set> ของ XSLT

การระบุและการใช้งาน

<xsl:attribute-set> องค์ประกอบสามารถสร้างชุดประกาศนามได้

หมายเหตุ:ต้องเป็นลูกของ <xsl:stylesheet> หรือ <xsl:transform>。

กราญาณา

<xsl:attribute-set
name="name" use-attribute-sets="name-list">
  <!-- Content:xsl:attribute* -->
</xsl:attribute-set>

คุณสมบัติ

คุณสมบัติ ค่า รายละเอียด
name name จำเป็น กำหนดชื่อของชุดคุณสมบัติ
use-attribute-sets name-list เลือกตั้ง ตัวแทนรายการชุดคุณสมบัติอื่นที่ใช้ในชุดคุณสมบัตินี้ แบ่งด้วยช่องว่าง

ตัวอย่าง

ตัวอย่าง 1

สร้างชุดคุณสมบัติที่สามารถนำไปใช้กับองค์ประกอบออกอากาศใดๆ ตามต้องการ (attribute-set ):

<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>