Re: style sheets with ancient browsers

James Aylett writes:
> <LINK REL=STYLESHEET TYPE="css/text" HREF="data: H1: { color: blue; }">
>
> I'm not sure if I've got the syntax, or even the scheme, correct

Bill Perry wrote:
> Its implemented in Emacs-W3 as of receving your message.  This is
> definitely the way to go.

Joel N. Weber II wrote:
> Looks good to me.  I think I'll implement that.


Be sure you implement the correct scheme!  Larry Masinter has written
an Internet Draft proposing the "data:" URL scheme which, i believe,
advanced to the status of "Proposed Standard" in August 1996.  It's
more flexible than the above, allowing types other than plain text,
so that (for example) you could also directly include small images in
an HTML document.

Basically, it suggests a data URL which looks like

    data:[<mediatype>][;base64],<data>

<mediatype> is optional, and if unspecified defaults to "text/plain".
With ";base64" the data is encoded as base64; without, the data is
literal (but since this is a URL unsafe characters are still escaped
with %xx).

This lets you include any small resource in your document.
His examples are:

> A data URL might be used for arbitrary types of data. The URL
> 
>       data:,A%20brief%20note
>
> encodes the text/plain string "A brief note", which might be
> useful in a footnote link.
>
> The HTML fragment:
> 
> <IMG
> SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
> AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz
> ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
> a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl
> ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis
> F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
> hhx4dbgYKAAA7"
> ALT="Larry">
>
> could be used for a small inline image in a HTML document.  (The
> embedded image is probably near the limit of utility. For anything
> else larger, data URLs are likely to be inappropriate.)
> 
> A data URL scheme's media type specification can include other
> parameters; for example, one might specify a charset parameter.
> 
>    data:text/plain;charset=iso-8859-7;%be%fg%be
> 
> can be used for a short sequence of greek characters.

All of the above has been taken from

    <URL:ftp://ietf.org/internet-drafts/draft-masinter-url-data-02.txt>

I think it would be great if this could be implemented as a
general way to include data wherever URLs are used today.


Ping

Received on Sunday, 12 January 1997 02:01:26 UTC