The following is a brief summary of the elements and attributes in the WML 1.2 Specification (the latest version as of this writing). Because it is new, not all browsers support the entire specification, so be sure to test your applications.
There are a few core attributes that can be used in nearly every element:
Specifies the language for the element.
Give the item a name that can be referred to later.
Specifies a class name for the element (so they can be grouped).
<a> |
<a>...</a> |
Specifies a link to another resource (a specific card or another .wml document).
Required. Location of the resource.
A brief text description of the link.
Assigns a keypad key to the link.
<access> |
<access/> |
Specifies a domain name. Only documents (decks) originating from that domain name can access the current document. The <access> element is contained within <head> tags.
The domain that can access the card.
Sets a path within the domain.
<anchor> |
<anchor>...</anchor> |
Specifies a generic link to another resource. It can be used in conjunction with the <go> and <prev> elements.
A brief text description of the link.
Assigns a keypad key to the link.
<card> |
<card>...</card> |
The unit within the WML document that displays in the device. Cards are logical divisions of the application's functionality.
A brief text description of the card. This may or may not be displayed by the device.
When set to true, this attribute reinitializes the state of the browser, clearing the navigational history and any stored variables.
Indicates how the card content is organized. A value of true indicates the card is part of a group of elements that are handled in sequence; false indicates there is no natural order.
<do> |
<do>...</do> |
Describes an action within the current card, generally assigned to a softkey on the device. The action is indicated by the elements <go>, <prev>, <noop>, or <refresh> within the <do> element.
Required. Describes the intended use for <do> element so the device can decide how to implement it.
Specifies a text label for the button or function.
When set to true, the browser can ignore the element. The default is false (the element must not be ignored).
Gives the element a name.
<fieldset> |
<fieldset>...</fieldset> |
Defines logical sections within content. It is currently poorly supported.
A brief text description of the section.
<go> |
<go/> |
Specifies a task that navigates to a resource (like a link). The xml:lang attribute is not allowed in this element.
Required. Specifies the destination URL.
The default is false. When set to true, the browser needs to specify the location of the deck containing this task in the request to the server.
The HTTP request method (for form data). It must be either of the values get or post. The default is get.
The content type of the form. The default is application/x-www-form-urlencoded.
A list of character encodings used to process the form data.
<img> |
<img/> |
Inserts an image into the content flow.
Required. The location of the image to be displayed.
Provides alternative text to be displayed if the image is missing.
Specifies a predefined icon from the built-in icon library.
Defines how the image is displayed relative to the surrounding text baseline.
Holds a specified number of pixels clear above and below the image.
Holds a specified number of pixels space to the left and right of the image.
Specifies the height of the image in pixels.
Specifies the width of the image in pixels.
<input> |
<input/> |
Adds a text-entry field to the document.
Required. The name of the variable that stores the user input.
Sets the type of text entry. The default text allows normal text entry; password hides the entered text from view by displaying stars or dots.
Provides a default value that displays when the element is loaded.
Specifies a format for the entered text to restrict text entry to specific alphanumeric patterns (such as dates or credit card numbers).
Indicates that it is okay to leave the field empty.
The width, in characters, of the text entry field.
Maximum length of the entered text (in characters).
Sets the order in which the form elements are tabbed through.
Specifies a description of the text entry screen; the description may or may not be displayed by the browser.
Assigns a keypad key to the field for quick access.
<meta> |
<meta/> |
Provides information about the document; it is placed within the <head> element.
Specifies the HTTP header name.
Specifies a name for the meta information.
Specifies whether the meta data is intended for the user agent (the browser). If set to false, it must be removed before it reaches the browser.
Required. Specifies the property value.
Used to interpret the data value.
<onevent> |
<onevent/> |
Triggers an action based on a specified event.
Required. Specifies the type of event that will trigger the task contained within the <onevent> element tags. The onenterbackward value specifies navigation through the browser's history; onenterforward specifies any navigation (except the back function); ontimer executes the action on timer expiration.
<option> |
<option>...</option> |
Specifies one selection within a <select> list.
Provides an optional variable for the selection, for example, to store an abbreviated version of the full selection name.
Gives the selection a name.
Specifies the id of a card to navigate to when the option is selected.
<optgroup> |
<optgroup>...</optgroup> |
Deliminates groups of <option>s within a <select> list.
Gives the submenu a title.
<p> |
<p>...</p> |
Specifies a paragraph of text.
Positions the text horizontally in the display.
Specifies the wrapping mode for the paragraph. nowrap causes the text to display on one line and may require horizontal scrolling.
<postfield> |
<postfield/> |
Specifies name-value pairs to send to the server.
Required. Specifies the name for the pair.
Required. Specifies the variable (value) for the pair.
<prev> |
<prev>...</prev> or<prev/> |
Instructs the browser to go back in its history stack to the previously viewed card. The standard attribute xml:lang is not permitted in this element.
<refresh> |
<refresh>...</refresh> |
Specifies a refresh task, which updates the browser context (clears history and stored variables).
<select> |
<select>...<select> |
Indicates a list of options in a form. The <select> element contains some number of <option> elements and may also contain <optgroup>s.
Specifies a title, which the browser may or may not display.
The name of the variable (the value is assigned when the user selects an option).
Allows a default value to be specified.
Specifies a variable whose value will be the index value of the chosen option.
Specifies a default selection using the default option's index number.
Determines whether multiple options may be selected from the list. The default is false (only one selection permitted).
Sets the order the select object appears as user tab through the fields.
<setvar> |
<setvar/> |
Specifies the name-value pair for a variable. If a variable already exists, it is overwritten. The <setvar> element may only be used within <refresh> and <go> tags.
Required. Specifies the name of the variable.
Required. Specifies the value of the variable.
<small> |
<small>...</small> |
Specifies that enclosed text should be slightly smaller than the default text size.
<strong> |
<strong>...</strong> |
Indicates strongly emphasized text. How it is rendered is device-dependent.
<table> |
<table>...</table> |
Indicates the beginning and end of a table.
Specifies the table's title, which the browser may or may not display.
Specifies the horizontal alignment of cell content for the table. The value is a string of the characters L, C, and R (representing left, center, and right, respectively), one for each column in the table. So a table with four columns might be aligned using align="RLRC".
Required. Specifies the number of columns in the table. This is a departure from table syntax in HTML.
<td> |
<td>...</td> |
Defines an individual cell in a table. The contents of the cell are placed within <td> container tags.
<template> |
<template>...</template> |
Specifies a template for all the cards in the deck, including <do> elements for softkey behaviors.
<timer> |
<timer/> |
Sets a timer that can be used to trigger events when it expires.
The name of the timer referenced by the event handler.
Required. Sets the length of time in tenths of seconds.
<tr> |
<tr>...</tr> |
Indicates a row within a table. Its contents are some number of <td> elements (table cells). The xml:lang attribute is not associated with this element.
<wml> |
<wml>...</wml> |
Indicates the beginning and end of a deck. It is the root element of a WML document (deck).
Copyright © 2002 O'Reilly & Associates. All rights reserved.