17. 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 (network unavailable, no resource available at the URI given, inability of the user agent to process the type of resource) 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" type="image/png">
    <span src="holiday.gif" type="image/gif">
        An image of us on holiday.

<table src="temperature-graph.png" type="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>

17.1. Embedding Attribute Collection

src = URI
This attribute specifies the location of an external source for the contents of the element.

In terms of [HLINK], the src attribute is specified as:

<hlink namespace="http://www.w3.org/2002/06/xhtml2"
type = ContentTypes

This attribute specifies the allowable content types of the relevant src URI. At its most general, it is a comma-separated list of media ranges with optional accept parameters, as defined for HTTP in section 14.1 of [RFC2616] as the field value of the accept request header of HTTP.

In its simplest case, this is just a media type, such as "image/png" or "application/xml", but it may also contain asterisks, such as "image/*" or "*/*", or lists of acceptable media types, such as "image/png, image/gif, image/jpeg".

The user agent must combine this list with its own list of acceptable media types by taking the intersection, and then use the resulting list as the field value of the accept request header when requesting the resource using HTTP.

For instance, if the attribute specifies the value "image/png, image/gif, image/jpeg", but the user agent does not accept images of type "image/gif" then the resultant accept header would contain "image/png, image/jpeg".

A user agent should imitate similar behavior when using other methods than HTTP. For instance, when accessing files in a local filestore, <p src="logo" type="image/png, image/jpeg"> might cause the user agent first to look for a file logo.png, and then for logo.jpg.

If this attribute is not present, "*/*" is used for its value.

For the current list of registered content types, please consult [MIMETYPES].

<script src="pop" type="application/x-javascript, text/x-newspeak"/>

<style src="midnight" type="text/css, text/x-mystyle"/>

<p src="w3c-logo" type="image/png, image/jpeg;q=0.2">W3C logo</p>

<span src="logo.png">Our logo</span>

<span src="theme.mp3" type="audio/x-mpeg">Our theme jingle</span>

Implementation: RELAX NG