MINSE: [index]
design - syntax - usage - notations - styles - contexts - why? - demo

Deploying MINSE on the World-Wide Web

The MINSE content type

The MIME Content-Type to use for MINSE expressions is text/x-minse. (The subtype is "x-minse" because this is an experimental type, as yet unregistered, while "text" was chosen for the top-level type because the meaning of an expression can be understood from the plain text, even if no renderer is available).

Using expressions in your HTML documents

I'm considering two ways of inserting mathematics into HTML at this time. Using the <OBJECT> tag fits perfectly with existing standards proposals, and avoids adding another tag to HTML. However, it can be a lot easier to just use a specialized tag for structured expressions, for which i propose the <SE> tag, and give reasons.


To place an expression in an HTML document, you can use the <OBJECT> tag, as defined by the recent W3C OBJECT Working Draft. Using the <OBJECT> tag, you can place objects from other files of different types into your HTML documents.

For mathematical expressions, however, it's quicker to just specify the expression in the tag itself, which can be accomplished with the data: URL scheme (as defined by the Data: Internet Draft by Larry Masinter). To represent an expression with an immediate URL, then, you give the scheme name (data:) followed by the Content-Type (text/x-minse), a comma, and then the text of the expression. Here is an example of such a URL as you might use it in an <OBJECT> tag in a document:

<OBJECT DATA="data:text/x-minse,a*'exp(x,2)+b*x+c=0">
(Your browser doesn't support mathematical expressions.  Fortunately,
you can <a href="http://www.lfw.org/math/nph-pmpm.cgi">
invoke Ping's MINSE polymediator</a> to render this equation for you.)
The contents of the element (between the <OBJECT> and </OBJECT> tags) are displayed in browsers that cannot render the content of the OBJECT. It is hoped that this MIME type will eventually be supported by browsers, and so this implementation is designed to let future support work as easily as possible without requiring anyone to change their documents.

Valid characters in URLs

Be careful with the characters you use in the OBJECT tag attribute. The set of "safe" characters in a URL is severely restricted by the various ways in which they are transported. According to the standard for URL syntax (Request For Comments 1738), only the following characters are allowed unescaped in URLs, aside from letters of the alphabet and digits:

+  -  =  .  _  /  *      (  )  ,  @  '  $  :  ;  &  !  ?

The special characters used in MINSE have been carefully chosen from this set so that you don't have to "escape" them in URLs (using a percent character and a hexadecimal number). After we set aside the parentheses, the comma, and the characters on the left, which are commonly used in expressions, we are left with just six choices for the macro escape character (the ampersand is inconvenient, because it needs to be represented as an entity; but much worse, far too many browsers are broken and will not parse SGML entities in attribute values). The single-quote was chosen for convenience, because it is a non-shifted key on North-American keyboards.

Anything that is not part of the "safe" character set must always be escaped in a URL. In particular, the percent character ("%") and the space must be escaped. Use the following codes:

for:     space     %
use:      %20     %25
Sorry about that, but i can't change the standard. There are good reasons for the decisions made in that document.

Using SE

This method is under consideration. Simply insert the expression between the tags <SE> and </SE>. For example:

<SE> a*'exp(x,2)+b*x+c=0 </SE>

How does one justify creating a new tag? First, the notation within the tag can be understood as text, so this method degrades reasonably well for browsers that don't support MINSE when the polymediator is not running. Second, the tag is removed by the polymediator, so what gets actually served is still quite valid HTML. Third, the expired HTML 3.0 draft suggested a new tag, <MATH> for mathematical expressions, but HTML 3.0 math has a much smaller scope of application than MINSE because it does not support multiple contexts, and is strongly based on visual, two-dimensional presentation. So it seems fair to introduce a new tag for structured expressions, which are more general.

Valid characters in markup

The latter method also greatly relieves many of the restrictions of URL characters, but you still have to watch out for the special characters in HTML, in particular the less-than and greater-than signs, which delimit tags, and the ampersand, which invokes SGML entities. Use the following codes:

for:       &        <        >
use:     &amp;     &lt;     &gt;

Invoking the MINSE polymediator

When you give the polymediator a URL to visit (from the form on the launchpad, for instance), your browser is actually making a request to a program instead of retrieving a document. You may notice that, when you browse with the polymediator, the string

is affixed to the beginning of the "real" URL. This passes your URL to a program called nph-pmpm.cgi at this site.

This program is a CGI script which fetches a requested document, processes any <OBJECT> elements in the document which have the Content-Type text/x-minse, and then sends you the results. Its job is to choose the appropriate set of macro definitions based on what it can determine about your client, and to apply them to the data in these elements. Right now, the only decision it makes is whether to produce text or an image (the audio link is always inserted).

Even though these lengthened URLs look strange and don't directly refer to real files, you can still treat them the same way as any others. In particular, you can bookmark them and you can link to them. If you want a link which causes a page to be processed by the MINSE polymediator, just add that string to the front of the URL yourself. In order to let people continue to browse sites containing MINSE easily, the polymediator also makes this change to all of the links in the document it fetches.

Using the polymediator on your pages

You may have noticed that the link in the <OBJECT> tag above points to http://www.lfw.org/math/nph-pmpm.cgi. This will be the address of the MINSE polymediator program. When a user activates the link, their browser will be redirected to a new URL that invokes the polymediator on the referring URL (the document that contains the link). So, including a link to http://www.lfw.org/math/nph-pmpm.cgi is all you need to do to let people render the expressions on a page with a single hyperlink.

The above example with the quadratic equation both supplies the expression in the <OBJECT> tag and provides a link for users who need to invoke the polymediator.

copyright © by Ping (e-mail) updated Mon 17 Jun 1996 at 10:19 JST
since Fri 24 May 1996