Making the APP tag legal

Paul Burchard (burchard@horizon.math.utah.edu)
Sat, 25 Mar 95 02:25:25 EST

Luke <ylu@ccwf.cc.utexas.edu> writes:
> The only thing this HotJava thing bothers me so far is
> their applet invoking method in their pseudo HTML, which
> I am pretty sure is not SGML based, since it's impossible
> to write a DTD for their APP element. The general syntax of
> the APP HTML tag:
>
> <APP CLASS="ClassName"
> SRC="URL"
> ALIGN=alignment
> WIDTH=widthInPixels
> HEIGHT=heightInPixels
> AppletSpecificAttribute=aValue
> ...>

Good call...it looks like they need to change to something like:

<APP BASE="package_URL" SRC="script" ALIGN=top WIDTH=9 HEIGHT=9>
<APPATTR NAME="color" VALUE="red">
<APPATTR NAME="texture" VALUE="fluffy">
...
Alternate <EM>rich</EM> text in case APP tag not supported.
</APP>

Notes:

(1) The above renders to nothing but the "alternate text" on
conforming HTML 2.0 browsers, for graceful degradation. (As in Dave
Raggett's FIG element, I'm likely assuming strict mode HTML, to
prevent SGML space parsing glitches.)

(2) The standard HTML 3.0 BASE attribute is used -- instead of SRC
-- to specify to the "directory" relative to which references to
auxiliary imported scripts should be interpreted. This allows SRC to
refer, as it should, to the actual script file to be loaded.
Moreover, since BASE defaults to the document URL, there is no need
to make extra provision for defaults.

(3) This HTML mechanism is not really Java-specific. The MIME type
of the SRC will determine the scripting language (e.g.,
application/java for Java scripts).

Here is my feeble attempt to crib a DTD fragment for the APP tag
(modified as above) based on Dave Raggett's HTML 3.0 work:

<!ENTITY % glyph.or.block.align
"align (top|middle|bottom|bleedleft|left
|center|right|bleedright|justify) top">
<!ELEMENT APP - - (APPATTR*, %flow;)>
<!ATTLIST APP
%attrs; -- common attributes for elements --
%needs; -- for control of text flow --
src %URI; #REQUIRED -- URI of script to invoke --
%url.link; -- standard link attributes --
%glyph.or.block.align; -- vert or horiz alignment --
width NUMBER #IMPLIED -- desired width in units --
height NUMBER #IMPLIED -- desired height in units --
hspace NUMBER #IMPLIED -- whitespace above/below in units--
vspace NUMBER #IMPLIED -- whitespace left/right in units --
units (em|pixels) pixels -- units are em's or pixels --
>
<!ELEMENT APPATTR - O EMPTY>
<!ATTLIST APPATTR
%attrs;
name NMTOKEN #IMPLIED -- or leave lax as CDATA? --
value CDATA #IMPLIED
>

How 'bout it?

--------------------------------------------------------------------
Paul Burchard <burchard@math.utah.edu>
``I'm still learning how to count backwards from infinity...''
--------------------------------------------------------------------