Java Applet element proposal

Terry Allen (terry@ora.com)
Thu, 1 Jun 95 20:02:35 EDT

This conversation has been going on on the Java mailing list, but should
perhaps be shifted to html-wg, thus the cross-post. I suggest followups
to html-wg.

| Subject: <APPLET> tag proposal
| Hi,
| As some of you may know the <APP> tag that is used in HotJava for
| defining applets is not compatible with the SGML standard. It uses an

read "HTML standard"

| arbitrary attribute list, which is something that is not expressible in
| an SGML DTD. We did not realize this until recently. We need to change

You can define a delimited list of attribute values in SGML;
is that what you're talking about?

| this if we ever want the applet tag to be accepted as part of the html
| standard.

I'm crossposting to html-wg@oclc.org to get this on the agenda.
THANK YOU for providing a DTD fragment!

| Below is a proposal for a new applet tags. We will implement this new
| tag in the beta release. Existing <APP> tags will be automatically
| converted to the new style. Please let us know what you think. This is
| the time to suggest changes!
| Have fun,
| Arthur van Hoff (avh@eng.sun.com)
| http://java.sun.com/people/avh/
| Sun Microsystems Inc, M/S UPAL02-301,
| 100 Hamilton Avenue, Palo Alto CA 94301, USA
| Tel: +1 415 473 7242, Fax: +1 415 473 7104
|
|
|
| *** DTD ***
|
| <!ELEMENT APPLET - - (PARAM*, DATA?, %flow)>
| <!ATTLIST APPLET
| CLASS NAME #REQUIRED -- the class name --
| NAME CDATA #IMPLIED -- the applet name --
| LANG NAME #IMPLIED -- the language name --
| SRC CDATA #IMPLIED -- source URL --
| WIDTH NUMBER #REQUIRED
| HEIGHT NUMBER #REQUIRED

Better not to make width and height required; some applets
might not use them.

| ALIGN (left|right|top|texttop|middle|
| absmiddle|baseline|bottom|absbottom) baseline
| VSPACE NUMBER #IMPLIED
| HSPACE NUMBER #IMPLIED
| >
|
| <!ELEMENT PARAM - O EMPTY>
| <!ATTLIST PARAM
| NAME NAME #REQUIRED -- The name of the parameter --
| VALUE CDATA #IMPLIED -- The value of the parameter --
| >

"Parameter" is mighty general. Could you find a more specific
name (appparam?)?

| <!ELEMENT DATA - - CDATA>

| *** Summary ***
|
| The <APPLET> tag has a required end tag and it can contain more than
| just parameters. Other browsers that do not recognize the tag will
| display this content, in HotJava it will be ignored.

Not a good idea. Anything that shouldn't be displayed should be
in an attribute value, or pointed at, so as not to break the
(non-SGML, sigh, but hey, you've got to choose your issues ...)
convention that tags not understood are ignored and their content
displayed. The content of DATA should not be displayed as text.

Why not make the DATA element empty and add an attribute that would
take a URI?

| The optional NAME attribute has a similar meaning as the NAME attribute
| of the <A> tag. It is used to locate an applet in a document using a
| symbolic name.
| The optional LANG attribute will allow applets to be implemented in
| languages other than Java. If it is specified and the language is not
| supported by the browser it should ignore the applet.
| The WIDTH and HEIGHT attributes are required. This means that pages
| with applets can be formatted quickly. Applets will still be able to
| override the specified width and height programatically.

But if they just make noises or smells, this won't help.

| The <DATA> tag can be used to supply the applet with raw data. For
| example, it could contain an XYZ list for an applet that displays
| chemical models.
|
| *** Example ***
|
| Here is an example of how an applet is currently defined
| with the <APP> tag:
|
| <APP CLASS=ThreeD SRC="applets/3D" MODEL="applets/3D/cube.obj"
| WIDTH=100 HEIGHT=100 SCALE=0.8 ALIGN=middle>
|
| With the <APPLET> tag the same applet would be defined as:
|
| <APPLET CLASS=ThreeD SRC="applets/3D/" ALIGN=middle WIDTH=100 HEIGHT=100>
| <PARAM NAME=model VALUE="applets/3D/cube.obj">
| <PARAM NAME=scale VALUE=0.8>
| If you where using <A HREF="http://java.sun.com/">HotJava</A>
| you would see a 3D cube here!
| </APPLET>

Or maybe I'd see an error message. If interpreted according to the DTD
in the HTML 2.0 spec

ftp://ftp.ds.internic.net/internet-drafts/draft-ietf-html-spec-03.txt

in which %flow; can contain PCDATA, you'll break your parse at the
first <PARAM> tag, because the line break after the APPLET start
tag uses up the PCDATA and take you to the end of the content model.
If you keep to empty tags (PARAM) you're okay.

What text (in %flow;) would you want to put here that shouldn't be
part of the applet?

| *** Caveat ***
|
| The new format is more verbose but it is expressible in SGML. By the
| way, you will never have to type it in if you use our HTML editor to
| create applets interactively.

If we *always* use your editor. But don't worry about that. Why
isn't

<APP CLASS=ThreeD SRC="applets/3D" MODEL="applets/3D/cube.obj"
WIDTH=100 HEIGHT=100 SCALE=0.8 ALIGN=middle>

okay already? You probably want to quote some of those values, but
why introduce those new elements?

In fact, why should this APP tag not be assimilated to a (discussed
but in no one's DTD) INCLUDE tag?

Regards,

-- 
Terry Allen  (terry@ora.com)   O'Reilly & Associates, Inc.
Editor, Digital Media Group    101 Morris St.
			       Sebastopol, Calif., 95472
occasional column at:  http://gnn.com/meta/imedia/webworks/allen/

A Davenport Group sponsor. For information on the Davenport Group see ftp://ftp.ora.com/pub/davenport/README.html or http://www.ora.com/davenport/README.html