Element XSLT <xsl:attribute-set>

Definicja i zastosowanie

Element <xsl:attribute-set> pozwala tworzyć nazwane zbiory atrybutów. Ten zbiór atrybutów (attribute-set) może być zastosowany jako całość do dokumentu wyjściowego.

Komentarz:Musi być dzieckiem <xsl:stylesheet> lub <xsl:transform>.

Gramatyka

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

Atrybut

Atrybut Wartość Opis
name name Wymagane. Określa nazwę zbioru atrybutów.
use-attribute-sets name-list Opcjonalnie. Lista innych zbiorów atrybutów używanych w tym zbiorze atrybutów, rozdzielonych spacjami.

Przykład

Przykład 1

Tworzenie zbioru atrybutów (attribute-set) aplikowalnych do dowolnego elementu wyjściowego:

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