Name
<xsl:attribute-set> — Allows you to define a group of attributes for the output document. You can then reference the entire attribute set with its name, rather than create all attributes individually.
Category
Top-level element
Required Attributes
- name
Defines the name of this attribute set.
Optional Attributes
- use-attribute-sets
Lists one or more attribute sets that should be used by this attribute set. If you specify more than one set, separate their names with whitespace characters. You can use this attribute to embed other
<xsl:attribute-set>s in this one, but be aware that an<xsl:attribute-set>that directly or indirectly embeds itself results in an error. In other words, if attribute setAembeds attribute setB, which in turn embeds attribute setC, which in turn embeds attribute setA, the XSLT processor will signal an error.
Content
One or more <xsl:attribute> elements.
Appears in
<xsl:stylesheet>. <xsl:attribute-set> is a top-level element and can only appear as a child of <xsl:stylesheet>.
Defined in
XSLT section 7.1.4, Named Attribute Sets.
Example
For this example, we’ll create a stylesheet that defines attribute sets for regular text, emphasized text, and large text. Just for variety’s sake, we’ll use the Extensible Stylesheet Language Formatting Objects (XSL-FO) specification to convert our XML document into a PDF file. Here’s our stylesheet:
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access