img

Element Information

Model

Attributes

QName Type Fixed Default Use Inheritable Annotation
alt Text required
class xs:NMTOKENS optional
dir restriction of xs:token optional
height Length optional
id xs:ID optional
ismap restriction of xs:token optional
lang LanguageCode optional
longdesc URI optional
onclick Script optional
ondblclick Script optional
onkeydown Script optional
onkeypress Script optional
onkeyup Script optional
onmousedown Script optional
onmousemove Script optional
onmouseout Script optional
onmouseover Script optional
onmouseup Script optional
src URI required
style StyleSheet optional
title Text optional
usemap URI optional
usemap points to a map element which may be in this document
or an external document, although the latter is not widely supported
width Length optional
xml:lang union of(xs:language, restriction of xs:string) optional
Attempting to install the relevant ISO 2- and 3-letter
         codes as the enumerated possible values is probably never
         going to be a realistic possibility.  See
         RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
         at http://www.iana.org/assignments/lang-tag-apps.htm for
         further information.

         The union allows for the 'un-declaration' of xml:lang with
         the empty string.

Used By

Element Group special

Source

<xs:element name="img">
  <xs:complexType>
    <xs:attributeGroup ref="attrs"/>
    <xs:attribute name="src" use="required" type="URI"/>
    <xs:attribute name="alt" use="required" type="Text"/>
    <xs:attribute name="longdesc" type="URI"/>
    <xs:attribute name="height" type="Length"/>
    <xs:attribute name="width" type="Length"/>
    <xs:attribute name="usemap" type="URI">
      <xs:annotation>
        <xs:documentation>usemap points to a map element which may be in this document or an external document, although the latter is not widely supported</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="ismap">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="ismap"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:complexType>
</xs:element>

Sample