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
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/
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.
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.
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 | ||
---|---|---|---|
indicates the WML version used. It is an error to omit this prologue | |||
comments will not be shown | |||
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. |
|||
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. |
|||
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. |
|||
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. |
WML markup | Attributes/Description | |
---|---|---|
Access-Control not yet written. | ||
Meta elements not yet written. |
The display of text in WML can be influenced by the following tags. How these tags are rendered partially depends on the user agent.
WML markup | Attributes/Description | |
---|---|---|
Emphasis | ||
Strong emphasis |
WML markup | Attributes/Description | |
---|---|---|
Italics font | ||
Bold font | ||
Underlined | ||
Bigger font | ||
Smaller font |
WML markup | Attributes/Description | |
---|---|---|
... | 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
|
|
Line break, equivalent to <BR> in HTML. |
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).
WML markup | Attributes/Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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:
|
||||||||||||||||||||||
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. | ||||||||||||||||||||||
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. | ||||||||||||||||||||||
is a short form of the <anchor>-tag. | |||||||||||||||||||||||
title=label href=URL |
For example
is equivalent to
|
WML markup | Attributes/Description | |
---|---|---|
declares a prev task, indicating navigation to the previous URI on the history stack. May contain <setvar>-elements. | ||
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. | ||
specifies, that nothing should be done ("no operation"). | ||
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 not yet written.
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.
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:
noesc
: No change of the value of the variable
escape
: URL-escape the value of the variable
unesc
: URL-unescape the value of the variable
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.)
$var
, $(var)
,
$(var)_x
$var_x
, $(var_x)
$(var:escape)
, $(var:E)
,
$(var:e)
, $(var:eScApE)
$(var:noesc)
, $(var:N)
,
$(var:n)
, $(var:nOeSc)
$(var_x:unesc)
, $(var_x:U)
,
$(var_x:u)
, $(var_x:uNeSc)
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 | ||
---|---|---|---|
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. |
||
specifies a table row and has (in comparsion to HTML no alignment attributes. May only contain <td>-elements. |
|||
... | | specifies a table field respective cell. It can contain any kind of text (including emphasized text and hyper-links) and images. |
Example:
could be rendered like:
Article Number Apples 12 Pears 29
Article Number Apples 12 Pears 29
Character entities not yet written.
Keywords: WML, XML, Unicode
WML reserves the use of several strings for future use. The following words are reserved:
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]