<c:attribute-set
name = eqname
use-attribute-sets? = eqname*
visibility? = "public" | "private" | "final" | "abstract" | "hidden" >
<!-- Content: c:attribute* -->
</c:attribute-set>Defines an attribute set.
- Category
- declaration
- Permitted parent elements
c:modulec:overridec:package
Attributes
name |
The name of the attribute set. |
use-attribute-sets |
Specifies other attribute sets to use before the current one. |
visibility |
Specifies how the current component can be used in other (using) packages. |
In addition to the attributes in the preceding table, there are a number of standard attributes that may appear on any XCST element.
Example: Using an Attribute Set
The following attribute set:
<c:attribute-set name='delete-btn'>
<c:attribute name='type'>submit</c:attribute>
<c:attribute name='name'>X-HTTP-Method-Override</c:attribute>
<c:attribute name='value'>DELETE</c:attribute>
<c:attribute name='onclick'>return confirm("Are you sure?")</c:attribute>
<c:attribute name='formnovalidate'>formnovalidate</c:attribute>
</c:attribute-set>
…can be used on a literal result element:
<button c:use-attribute-sets='delete-btn'>Delete</button>
…or on c:element:
<c:element name='button' use-attribute-sets='delete-btn'>Delete</c:element>
Note: Differences with xsl:attribute-set
Unlike xsl:attribute-set, c:attribute-set does not allow multiple declarations with the same name in the same module. Also, c:attribute-set declarations with higher import precedence hide declarations with lower import precedence, which means hidden declarations are never evaluated.
Error Conditions
It is a compilation error if the name attribute uses a reserved namespace.
It is a compilation error if an c:attribute-set declaration has visibility='abstract' and the content of the element is non-empty.
It is a compilation error if another c:attribute-set declaration with the same name exists in the containing module.
It is a compilation error if the use-attribute-sets attribute specifies a name that does not match the name of any c:attribute-set declaration in the containing package.