Legacy web pages of Axel Beckert

Since I'm no more active at the Fachschaftsrat Informatik of the University of Saarland anymore, I have transferred all my university time legacy web pages from http://fsinfo.cs.uni-sb.de/~abe/ to this interim host at http://fsinfo.noone.org/~abe/ with only minimal modifications, mainly e-mail addresses.

Most pages on this interim host won't be updated anymore until they are moved (and redirected) step by step to their future home somewhere under http://noone.org/.

Please also note that my former e-mail address abe@fsinfo.cs.uni-sb.de is no more valid. Use abe@deuxchevaux.org instead.

Axel Beckert, Zürich, 23rd of September 2007


A Short WML 1.1 Reference

by Axel Beckert (abe@deuxchevaux.org)

This Wireless Markup Language (WML) reference relates to WAP WML version 1.1 from 16-Jun-1999. If possible, the equivalent HTML code is mentioned or the differences to HTML are shown up.
Compiled WML (aka WMLC), WMLScript and Wireless Bitmaps (aka WBMP) are left out.
More information can be found at: http://www.wapforum.org/


Table of Contents


General Syntax

All WML-tags are enclosed in <...>. The tag has to follow the open bracket directly without space. WML is (in comparsion to HTML) case-sensitive (<tag> is not equal to <TAG>) and all WML-tags are lower-case.

Tab, blank, carriage return and line feed are treated as spaces. One or more spaces directly before or behind a tag are ignored. Several consecutive spaces are treated as one single space.

There is a differentiation between standalone-tags and paired tags. Standalone-tags (like <tag/>) can appear everywhere in the text. Please note the trailing slash ("/"), it always appears before the closing ">". Paired tags (e.g. <tag> and </tag>; also called container) enclose text and have the form <tag>...</tag> like in HTML. Interlocked tags have to be closed in reverse order of opening, like in HTML, too: <a><b>...</b></a>

Some WML tags may occur in both forms, as standalone-tag and as paired tag. If the tag is used as standalone-tag, the slash must appear at the end of the tag, else it must appear at the beginning of the closing tag.

Attributes to tags have the same syntax as in HTML, except that standalone-tags need the trailing slash behind the attribute (e. g. <tag attribute="abc"/>).

As in HTML documents are specified by a uniform resource locator (URL):

method://server[:port]/[path/][file][#cards]
(Actually only http is allowed as method, e.g. mailto: and tel: links are not allowed.)

The only difference in comparsion to HTML is that fragment anchors -- the URL part starting with an hash mark ("#") -- refer to cards and not to reference anchors.


Restrictions in Document Size

Most emulators actually don't care about, that mobile devices may have problems storing and parsing large WML decks, so always remember, that big WML decks may properly work on every emulator you have around, but will not work on most WAP devices.

The size of WML pages is restricted to 1024 Bytes in the binary WMLC (Compiled WML) format. So if you want to test, if your pages has the right size, you have to compile it, e.g. with the wml tools by Thomas Neill.


Document Structure

A lot of the following descriptions are cited from [WML, 1999].

WML data are structured as a collection cards. A single collection of cards is referred to as a WML deck. Each card contains structured content and navigation specifications. Logically, a user navigates through a series of cards, reviews the contents of each, enters requested information, makes choices and navigates to another card or returns to the previously visited card.

WML markup Attributes/Description
<?xml version="1.0"?> <!DOCTYPE WML PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> indicates the WML version used. It is an error to omit this prologue
<!-- comment text --> comments will not be shown
<wml>...</wml>

The <wml>-container defines a deck of cards and encloses all information and cards in the deck.

It must contain at least one <card>-container and can additionaly contain one <head>-container and one <template>-container.

<head>...</head>

The <head>-container is optional. It contains information relating to the deck as a whole, including meta-data and access control elements.

It must contain at least one <meta>-element or one <access>-element.

<template>...</template>

declares a template for cards in the deck. Event bindings specified here apply to all cards in the deck. A <card>-element may override respective removing the declaration in <template>-container for it's own content by redefining it respective redfining it with <noop/>.

Templates can only contain <do>-elements or <onevent>-elements.

<card>...</card> encloses one WML card and is similar to HTML <BODY>-tag, but may appear not only once in a document. A card inside a deck is referred by using it's id as fragment anchor in an URL.
id=name sets the name of a WML card. The id is used to identify a card inside a deck. You can refer to it by using this id as fragment anchor in an URL, e. g. would the card surrounded by <card id="one">...</card> in the deck index.wml referred as index.wml#one.
title=label sets the title of a WML card. This value has similiar functions to the <TITLE>-tag in HTML.
newcontext=[true|false]
Default: false
true indicates that the current browser context should be re-initialised upon entry to this card.
ordered=[true|false]
Default: true
specifies a hint to the user agent about the organisation of the card content. This hint may be used to organise the content presentation or to otherwise qinfluence the layout of the card.

Header Elements

WML markup Attributes/Description
<access/> Access-Control not yet written.
<meta/> Meta elements not yet written.

Text Elements

The display of text in WML can be influenced by the following tags. How these tags are rendered partially depends on the user agent.

Logical formats

WML markup Attributes/Description
<em>...</em> Emphasis
<strong>...</strong> Strong emphasis

Physical formats

WML markup Attributes/Description
<i>...</i> Italics font
<b>...</b> Bold font
<u>...</u> Underlined
<big>...</big> Bigger font
<small>...</small> Smaller font

Paragraph and line formatting

WML markup Attributes/Description
<p>...</p> Paragraph
align=[right|left|center]
Default: left
specifies the text alignment mode.
mode=[wrap|nowrap]

specifies the line-wrap mode. wrap specifies breaking text mode and nowrap specifies non-breaking text mode.

If not explicitly specified the line-wrap mode is identical to the line-wrap mode of the previous paragraph in the actual WML card. The default mode for the first paragraph in a card is wrap.

<br/> Line break, equivalent to <BR> in HTML.

Hypertext links

In comparision to HTML there are several ways to implement hyper-links. A hyper-link is splitted into two parts: Header (for specifying the kind, the link is shown) and tasks (for specifying what to or where to go).

Hyper-link header elements

WML markup Attributes/Description
<do>...</do>

provides a general mechanism for the user to act upon the current card. The representation of the do element is user agent dependent and you must only assume that the element is mapped to unique user interface widget, that the user can activate. For example, the widget mapping may be to a graphically rendered button, a soft or function key, or a voice-activated command sequence.

The action to do, when activating a do-element, can be specified by one of the following WML tags: go, prev, noop or refresh.

type=do-type
Required.

provides a hint to the user agent about the author's intended use of the element and how the element should be mapped to physical user interface construct.

All types are reserved, except for those marked as experimental oder vendor-specific.

The following do-types are predefined:
type description
accept positive acknowledgement
prev backward history navigation
help request for help
reset clearing or resetting state
options request for options or additional operations
delete delete item or choice
unknown generic type
"" (the empty string) equivalent to unknown
x-*, X-* experimental type
vnd.*, VND.* vendor or user agent specific type of the kind vnd.co-type, where co is a company name abbreviation and type is the do-type. (See RFC2045 for details)

label=label specifies a textual string suitable for dynamically labelling the user interface widget. If an element can not dynamically labelled, this attribute may be ignored. To work well on a broad range of user agents, you should limit all labels to a length of 6 characters.
name=name-token If two <do>-elements on deck- (means inside a <template>-tag) and card-level have the same name, the card-level <do>-element overrides the deck-level <do>-element with that name.
optional=[true|false]
Default false
If this attribute is set to true, the user agent may ignore this element.
<anchor>...</anchor> specifies the head of an hyper-link. The text or image between to opening and closing <anchor>-tag will show up as clickable link.

The ressource, which should be loaded when using this link, can be specified by one of the following WML tags: go, prev or refresh

title=label specifies a brief text string identifying the link. The user agent may display it in a variety of ways, including dynamic labelling of buttons or keys, tool tips, voice prompt, etc. The user agent may truncate or ignore this attribute depending on the characteristics of the navigational user interface. To work well on a broad range of user agents, you should limit all labels to a length of 6 characters.
<a>...</a> is a short form of the <anchor>-tag.
title=label
href=URL
For example
<anchor title="FOOBAR">link to FooBar <go href="http://foobar.org/foobar.html"> </anchor>
is equivalent to
<a title="FOOBAR" href="http://foobar.org/foobar.html">link to FooBar</a>

Hyper-link task elements

WML markup Attributes/Description
<prev/> declares a prev task, indicating navigation to the previous URI on the history stack. May contain <setvar>-elements.
<refresh/> declares a refresh task, indicating an update of the user agent context as specified by the contained <setvar>-elements. User-visible side effects of the state changes occur during the processing of the refresh task.
<noop/> specifies, that nothing should be done ("no operation").
<go/>

declares a go-task.

It may contain one or several <postfield>-elements or <setvar>-elements.

href=URI specifies the destination URI.
sendreferer=[true|false] Default: false If this attribute is set to true, the user agent must specify the URI of the deck containing this task in the request sent to the server.
method=[get|post] Default: get specifies the HTTP request method.
accept-charset=charset-list Default: unknown specifies the list of character-encodings for data that the origin server must accept when processing input.

Images

Images not yet written.


Forms

Forms are used to interrogate information that will be returned to the Server. These will be handed over to a CGI-script that processes them.

Forms not yet written.


Variables

All WML content can be parameterised, allowing the author flexibility in creating cards and decks with improved caching behaviour and better perceived interactivity. WML variables can be used in the place of string and are substituted at run-time with their current value. Only text (incl. attribute values) can be substituted, no substitution of WML-elements nor their attributes is possible. A variable is said to be set if it has a value not equal the empty string (""). WML variable names are case sensitive and can consist of one or more 7-bit ASCII letters, digits and the underscore (_). The first character of a variable name must not be a digit. WML variable are reference by a dollar sign ($) followed by the of the variable. The name may be put in parentheses.

The kind of escaping the variables value can be determined with one of three (case insensítive) modifierers, appended to the variable name with a colon (:) and parenthesized together. The three escaping modifiers are:

You may use the short forms n, e and u instead of the above given modifiers. If you don't specify any modifier, no escaping is done, except, if the variable appears in an URL attribute context, e. g. a href or src attribute.

Examples:
(One line always show the same variable and the same escaping method.)


Tables

Tables in WML are similiar to HTML 3.2 tables. The most important difference is the needed presence of a columns attribute to the <table<-element. Other difference is that nesting of tables is not allowed and that there is no special table header cell tag.

WML markup Attributes/Description
<table>...</table> creates a table. May only contain <tr>-elements.
columns=#columns specifies the numbers of columns in this table. Must be present.
title=label specifies a brief text string identifying the link. The user agent may display it in a variety of ways, including dynamic labelling of buttons or keys, tool tips, voice prompt, etc. The user agent may truncate or ignore this attribute depending on the characteristics of the navigational user interface. To work well on a broad range of user agents, you should limit all labels to a length of 6 characters.
align=[LCR]{#columns} specifies the default alignment for each column. The attribute value is interpreted as a list of alignment designations, one for each column. L stands for left, C stands for center and R for right alignment. This is unequal to HTML, but very similiar to LaTeX's tabular and array environments.
<tr>...</tr>

specifies a table row and has (in comparsion to HTML no alignment attributes. May only contain <td>-elements.

<td>...</td>

specifies a table field respective cell. It can contain any kind of text (including emphasized text and hyper-links) and images.

Example:

<table columns="2" align="LC"> <tr><td>Article</td> <td>Number</td></tr> <tr><td>Apples</td> <td>12</td></tr> <tr><td>Pears</td> <td>29</td></tr> </table>

could be rendered like:
ArticleNumber
Apples12
Pears29


Special Characters

Character entities not yet written.

Keywords: WML, XML, Unicode

Reserved Tags

WML reserves the use of several strings for future use. The following words are reserved:


Literature

WML, 1999
Wireless Application Protocol, Wireless Markup Language Specification Version 1.1; Wireless Application Protocol Forum Ltd.; 1999; http://www.wapforum.org/

Based on the Short HTML Reference by Stephan Wiehr (lynx@fsinfo.cs.uni-sb.de) and Axel Beckert (abe@deuxchevaux.org)

Last modification: [wml11.html: Fri 31-May-2002 18:34:15 (MET) abe@deuxchevaux.org]
© 2000-2001 by Axel Beckert