The smallest unit of HDML an UP.Link service can send to a phone is a deck1. A deck contains one or more cards, each of which specifies a single interaction between the phone and the user. HDML currently supports the following types of cards:
When a phone receives a deck, it normally goes to the first card in the deck. It displays the information the card provides and allows the user to respond to it. Depending on the card type, the user can respond by entering text or choosing an option, and then pressing a function key.
The following HDML statements are an example of an HDML deck containing two display cards. When a phone loads this deck, its display appears similar to the display at the top of Figure 1-2. If the user presses ACCEPT (the softkey below the OK label), the phone display appears similar to the display at the bottom of Figure 1-2. Following Figure 1-2 is a line-by-line description of the HDML.
1<HDML VERSION="3.0"> <DISPLAY> <ACTION TYPE=ACCEPT TASK="GO" DEST="#card2"> The Queen said: Off with her head! </DISPLAY> <DISPLAY NAME="card2"> Alice said: You're nothing but a deck of cards. </DISPLAY> </HDML> FIGURE 1-2. HDML deck with two cards
This line defines the header of the HDML deck. All HDML decks must begin with an <HDML> tag and end with an </HDML> tag.
Most HDML tags, such as the <HDML> tag, allow you to specify options. Options take the form, OPTION=value, where OPTION is the option name and VALUE is an alphabetic or numeric value that you specify. Some options, such as the VERSION option in the HDML tag, are required. Option syntax is described in more detail in the following section.
This line defines the header of the first display card. Like HDML decks, cards require begin and end tags (for example, <DISPLAY> and </DISPLAY>).
This line defines an action, which specifies what the phone should do when the user presses a specified function key. The TYPE option identifies the key (ACCEPT), the TASK option identifies what the phone should do (go to another deck or card), and the DEST (destination) option identifies where to go (the card named card2).
This line provides the text that is displayed on the phone.
This line defines the header of the second display card. It uses the NAME option to specify the card's name. Although the NAME option is not required, it is necessary to specify a name so that other cards can reference the card as a destination.