4. XML Attributes

XML attributes provide additional and extra information about an element. XML attributes are placed inside the starting tag of an element. XML attributes come in name and value pairs.

Example 4.1 An XML Attribute
<sampleelement sampleattribute="sampleattributevalue" />

The name of the element is "sampleelement". The name of the attribute is "sampleattribute". The value of the attribute is "sampleattributevalue".


Since the element itself is empty it is closed by a trailing "/". This is refered to as a self closing element.