Page 1
What Is What?
Intro to HDML
Page 2 — Getting Ready for HDML
To get started, you need to have a Web server that's set up to
serve these kinds of files. If you or your host use Apache or
another NCSA-based server, you simply need to create a file
called .htaccess (don't forget the initial dot) in your top-level
HTML directory containing the lines shown below. The second
statement column (after "addtype") is the mime type, the last
part is the file extension:
With other servers, you just need to add the equivalent lines to
your mime configuration in the appropriate way.
Once you're ready to roll, the next step is to build an HDML
deck.
Intro to HDML
Page 3 — Writing HDML
As with HTML, every deck starts with <HDML> and ends with
</HDML>. It is mandatory, though, to specify the language
version number in the opening statement, so it should actually
look like this: <HDML VERSION=3.0>.
<HDML VERSION=3.0>
<DISPLAY NAME=jan>
<ACTION TYPE=ACCEPT LABEL=Feb TASK=GO DEST=#feb>
January rainfall
<BR>1998: 19
<BR>1997: 15
</DISPLAY>
<DISPLAY NAME=feb>
<ACTION TYPE=ACCEPT LABEL=Mar TASK=GO DEST=#mar>
February rainfall
<BR>1998: 14
<BR>1997: 10
</DISPLAY>
<DISPLAY NAME=mar>
March rainfall
<BR>1998: 18
<BR>1997: 19
</DISPLAY>
</HDML>
The output of this code looks like this:
There are two ways to receive user input in HDML: Entry cards
allow users to (laboriously) key in information, and choice
cards allow them to choose from a list. Here is a sample entry
card:
<HDML VERSION=3.0>
<ENTRY KEY=name FORMAT=A*a>
<ACTION TYPE=ACCEPT TASK=GO DEST=#ssn>
What's your name?
</ENTRY>
<ENTRY NAME=ssn KEY=socsec FORMAT="NNN\-NN\-NNNN">
<ACTION TYPE=ACCEPT TASK=GO DEST=#show>
What's your Social Security number?
</ENTRY>
<DISPLAY NAME=show>
Hello, $name! I bet $socsec isn't your REAL Social Security
number.
</DISPLAY>
</HDML>
<HDML VERSION=3.0>
<DISPLAY>
<IMG SRC="images/kitty1" ALT="My kitty!">
</DISPLAY>
</HDML>
Your users will get this:
And that's about it. While there is a bit more to HDML (not to
mention WML and WAP), that's enough to get you started.
When you're ready to start building huge e-commerce sites in
HDML, you may want to check out the HDML Developer's Guide
and the HDML 3.0 Language Reference to learn about things
like advanced variable handling, using images in links,
bookmarks, hardware sniffing, nested activities, caching,
security, push, dynamic pages, etc.
The wireless industry continues to embrace WAP, but it's hard
to predict how soon and how widely the advanced features will
catch on. Keep an eye on that phone availability page to see
which devices are shipping with UP.Browser 4.0, which older
ones support HDML only or 3.1, which devices can shake hands
with WML and HDML, and which ones are compatible with later
releases of the version 4.0 browser. In fact, the 4.0 version
adds support for WMLScript, the scripting language of the
wireless world's miniature Web.
Now get coding! The mobile surfers are dying for juicy content.