Element <xsl:attribute-set> w XSLT

Definicja i użycie

Element <xsl:attribute-set> pozwala tworzyć nazwane zbory atrybutów. Zbór atrybutów (attribute-set) może być zastosowany jako całość w wyjściowym dokumencie.

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ę zestawu atrybutów.
use-attribute-sets name-list Opcjonalne. Lista innych zestawów atrybutów używanych w tym zestawie atrybutów, oddzielonych spacjami.

Przykład

Przykład 1

Tworzenie zestawu atrybutów (attribute-set), który można zastosować do każdego 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>