Attributes
The Attribute element represents a single attribute in the output. The Name attribute specifies the name of the attribute. The content of this element represents the attribute value:
<attribute name="author">J. Smith</attribute>
Usage with element definitions
The primary need for this element is to add attributes to output elements that are defined using the Element element described above. The Attribute element is placed within the Element element:
<template match="book"> <element name="DOC"> <attribute name="AUTHOR">J. Smith</attribute> <apply-templates/> </element> </template> <DOC AUTHOR="J. Smith">...</DOC>
The attribute is attached to the nearest ancestor element definition (the nearest element that encloses it). In the following ...
Get XSL companion, The now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.