Attributes

It is possible for an element to hold additional information about its content beyond just its name. For example, the target audience for the content of a particular Paragraph element may be governed by a security level value, and each paragraph may be associated with a particular author. This 'information about information' is termed meta-data, and is stored in an attribute. An attribute has both a name and a value. In the following example, a paragraph is designated as secret using an attribute which is embedded within the start-tag:

<para security="secret" >
  ...
</para>

Attributes can also be embedded within an empty element tag. For example, a placeholder for an image would need to use an attribute to identify the image to be ...

Get XML Companion, The, Third Edition 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.