19. XHTML Embedding Attributes Module


This section is normative.

The Embedding Attributes module defines the Embedding attribute collection.

This collection causes the contents of a remote resource to be embedded in the document in place of the element's content. If accessing the remote resource fails, for whatever reason (e.g., network unavailable, no resource available at the URI given, inability of the user agent to process the type of resource) or an associated @ismap attribute fails, the content of the element must be processed instead.

Note that this behavior makes documents far more robust, and gives much better opportunities for accessible documents than the longdesc attribute present in earlier versions of XHTML, since it allows the description of the resource to be included in the document itself, rather than in a separate document.


<p src="holiday.png" srctype="image/png">
	<span src="holiday.gif" srctype="image/gif">
		An image of us on holiday.
<table src="temperature-graph.png" srctype="image/png">
<caption>Average monthly temperature over the last 20 years</caption>
<tr><td> 4</td><td> 2</td><td> 7</td><td> 9</td><td>13</td><td>16</td>
    <td>17</td><td>17</td><td>14</td><td>11</td><td> 7</td><td> 4</td>

19.1. Embedding Attribute Collection

encoding = Encodings
This attribute specifies the allowable encoding of the external resource referenced by the @src attribute. At its most general, it is a comma-separated list of encodings, such as "utf-8", "utf8, utf-16", or "utf-8, utf-16, *".

The user agent must use this list as the field value of the accept-charset request header when requesting the resource using HTTP.

If this attribute is not present, the user agent must use its default value of the accept-charset request header.

User agents should use a similar technique when using other protocols that allow encoding negotation

When using protocols that do not allow encoding negotiation to retrieve resources whose encodings are not self-identifying, the user agent should use the first encoding in the attribute's value as the indication of the resource.


<style type="text/css" src="style/home" encoding="utf-8" /> 
src = URI
This attribute specifies the location of an external source for the contents of the element. Actuation occurs as the default action of a [DOM] load event for the element that the attribute occurs on.
srctype = ContentTypes

This attribute specifies the allowable content types of the resource referenced by the relevant @src URI.


<handler src="pop" srctype="application/x-javascript, text/x-newspeak" />
<style src="midnight" srctype="text/css, text/x-mystyle" />
<p src="w3c-logo" srctype="image/png, image/jpeg;q=0.2">W3C logo</p>
<span src="logo.png">Our logo</span>
<span src="theme.mp3" srctype="audio/x-mpeg">Our theme jingle</span>

Implementations: RELAX NG, XML Schema