Contents
This section is normative.
This module is deprecated. Similar functionality can be found in the Object Module.
The Applet Module provides elements for referencing external: applications. Specifically, the Applet Module supports the following elements and attributes:
Element | Attributes | Minimal Content Model |
---|---|---|
applet | Core, alt* (Text), archive (CDATA), code (CDATA), codebase (URI), height* (Length), object (CDATA), width* (Length) | (PCDATA | Flow | param)* |
param | id (ID), name* (CDATA), type (ContentType), value (CDATA), valuetype ("data"* | "ref" | "object") | EMPTY |
When the Applet Module is used, it adds the applet
element to the
Text content set of the Inline Text Module.
Implementations: DTD, XML Schema
This element, supported by all Java-enabled browsers, allows designers to embed a Java applet in an XHTML document. It has been Deprecated. in favor of the object element.
Attributes
Attribute Style not found
The attribute Style was not able to be loaded by the document generator. This implies that either 1) the attribute is not yet defined, or 2) the name is incorrect.When the applet is "deserialized" the start() method is invoked but not the init() method. Attributes valid when the original object was serialized are not restored. Any attributes passed to this applet instance will be available to the applet. Authors should use this feature with extreme caution. An applet should be stopped before it is serialized.
Either @code or @object must be present. If both @code and @object are given, it is an error if they provide different class names.
This attribute specifies a default width for each column in the current colgroup, or the width for each column spanned by the current col element. In addition to the standard pixel, percentage, and relative values, this attribute allows the special form "0*" (zero asterisk) which means that the width of each column in the group should be the minimum width necessary to hold the column's contents. This implies that a column's entire contents must be known before its width may be correctly computed. Authors should be aware that specifying "0*" will prevent visual user agents from rendering a table incrementally.
This attribute is overridden for any column in the column group whose @width is specified via a col element.
This attribute when used with the col element refers to the width of each column in the element's span.
Several non-textual elements let authors specify alternate text to serve as content when the element cannot be rendered normally. Specifying alternate text assists users without graphic display terminals, users whose browsers don't support forms, visually impaired users, those who use speech synthesizers, those who have configured their graphical user agents not to display images, etc.
While alternate text may be very helpful, it must be handled with care. Authors should observe the following guidelines:
The content of the applet acts as alternate information for user agents that don't support this element or are currently configured not to support applets. User agents must ignore the content otherwise.
DEPRECATED EXAMPLE:
In the following example, the applet element includes a Java applet in the document. Since no codebase is supplied, the applet is assumed to be in the same directory as the current document.
<applet code="Bubbles.class" width="500" height="500"> Java applet that draws animated bubbles. </applet>
This example may be rewritten with object as follows:
<P><object codetype="application/java" classid="java:Bubbles.class" width="500" height="500"> Java applet that draws animated bubbles. </object>
Initial values may be supplied to the applet via the param element.
DEPRECATED EXAMPLE:
The following sample Java applet:
<applet code="AudioItem" width="15" height="15"> <param name="snd" value="Hello.au|Welcome.au"> Java applet that plays a welcoming sound. </applet>
may be rewritten as follows with object:
<object codetype="application/java" classid="AudioItem" width="15" height="15"> <param name="snd" value="Hello.au|Welcome.au"> Java applet that plays a welcoming sound. </object>
Attributes
Possible values:
PARAM elements specify a set of values that may be required by an object at run-time. Any number of PARAM elements may appear in the content of an OBJECT or APPLET element, in any order, but must be placed at the start of the content of the enclosing OBJECT or APPLET element.
The syntax of names and values is assumed to be understood by the object's implementation. This document does not specify how user agents should retrieve name/value pairs nor how they should interpret parameter names that appear twice.
We return to the clock example to illustrate the use of PARAM: suppose that the applet is able to handle two run-time parameters that define its initial height and width. We can set the initial dimensions to 40x40 pixels with two PARAM elements.
<P><OBJECT classid="http://www.miamachina.it/analogclock.py"> <PARAM name="height" value="40" valuetype="data"> <PARAM name="width" value="40" valuetype="data"> This user agent cannot render Python applications. </OBJECT>
In the following example, run-time data for the object's "Init_values" parameter is specified as an external resource (a GIF file). The value of the valuetype attribute is thus set to "ref" and the value is a URI designating the resource.
<P><OBJECT classid="http://www.gifstuff.com/gifappli" standby="Loading Elvis..."> <PARAM name="Init_values" value="./images/elvis.gif"> valuetype="ref"> </OBJECT>
Note that we have also set the standby attribute so that the user agent may display a message while the rendering mechanism loads.
When an OBJECT element is rendered, user agents must search the content for only those PARAM elements that are direct children and "feed" them to the OBJECT.
Thus, in the following example, if "obj1" is rendered, "param1" applies to "obj1" (and not "obj2"). If "obj1" is not rendered and "obj2" is, "param1" is ignored, and "param2" applies to "obj2". If neither OBJECT is rendered, neither PARAM applies.
<P> <OBJECT id="obj1"> <PARAM name="param1"> <OBJECT id="obj2"> <PARAM name="param2"> </OBJECT> </OBJECT>
The location of an object's implementation is given by a URI. The first segment of an absolute URI specifies the naming scheme used to transfer the data designated by the URI. For XHTML documents, this scheme is frequently "http". Some applets might employ other naming schemes. For instance, when specifying a Java applet, authors may use URIs that begin with "java" and for ActiveX applets, authors may use "clsid".
In the following example, we insert a Java applet into an XHTML document.
<P><OBJECT classid="java:program.start"> </OBJECT>
By setting the codetype attribute, a user agent can decide whether to retrieve the Java application based on its ability to do so.
<OBJECT codetype="application/java-archive" classid="java:program.start"> </OBJECT>
Some rendering schemes require additional information to identify their implementation and must be told where to find that information. Authors may give path information to the object's implementation via the codebase attribute.
<OBJECT codetype="application/java-archive" classid="java:program.start"> codebase="http://foooo.bar.com/java/myimplementation/" </OBJECT>
The following example specifies (with the classid attribute) an ActiveX object via a URI that begins with the naming scheme "clsid". The data attribute locates the data to render (another clock).
<P><OBJECT classid="clsid:663C8FEF-1EF9-11CF-A3DB-080036F12502" data="http://www.acme.com/ole/clock.stm"> This application is not supported. </OBJECT>
To declare an object so that it is not executed when read by the user agent, set the boolean declare attribute in the OBJECT element. At the same time, authors must identify the declaration by setting the id attribute in the OBJECT element to a unique value. Later instantiations of the object will refer to this identifier.
A declared OBJECT must appear in a document before the first instance of that OBJECT.
An object defined with the declare attribute is instantiated every time an element that refers to that object requires it to be rendered (e.g., a link that refers to it is activated, an object that refers to it is activated, etc.).
In the following example, we declare an OBJECT and cause it to be instantiated by referring to it from a link. Thus, the object can be activated by clicking on some highlighted text, for example.
<P><OBJECT declare id="earth.declaration" data="TheEarth.mpeg" type="application/mpeg"> The <STRONG>Earth</STRONG> as seen from space. </OBJECT> ...later in the document... <P>A neat <A href="#earth.declaration"> animation of The Earth!</A>
The following example illustrates how to specify run-time values that are other objects. In this example, we send text (a poem, in fact) to a hypothetical mechanism for viewing poems. The object recognizes a run-time parameter named "font" (say, for rendering the poem text in a certain font). The value for this parameter is itself an object that inserts (but does not render) the font object. The relationship between the font object and the poem viewer object is achieved by (1) assigning the id "tribune" to the font object declaration and (2) referring to it from the PARAM element of the poem viewer object (with valuetype and value).
<P><OBJECT declare id="tribune" type="application/x-webfont" data="tribune.gif"> </OBJECT> ...view the poem in KublaKhan.txt here... <P><OBJECT classid="http://foo.bar.com/poem_viewer" data="KublaKhan.txt"> <PARAM name="font" valuetype="object" value="#tribune"> <P>You're missing a really cool poem viewer ... </OBJECT>
User agents that don't support the declare attribute MUST render the contents of the OBJECT declaration.