This tip is excerpted from an article on the InformIT Web site. The article discusses the Wireless Application Protocol, one part of which is Wireless Markup Language. Anyone who wants to use wireless hand-held devices should have at least an understanding of WAP and WML.
WAP, the Wireless Application Protocol, is a set of standards specifically designed to meet the challenges of the wireless Internet. An important part of WAP is the Wireless Markup Language (WML), used to define content for WAP devices. WML version 1.2 is an approved standard, although most current devices only support WML 1.1. Like HTML, WML is a markup language providing layout, data entry, and navigation. However, WML differs from HTML in many areas, as it must address the limitations of wireless devices�small displays, lightweight processors, and slow connections. WML provides an explicit navigation model that helps wireless devices ensure that navigation elements are visible to the user despite the limited display area. The deck/card layout of WML reduces network round-trips, and simple built-in field validation reduces the need to code CPU-intensive scripts.
At its most basic, WML gives us the following:
- A deck and card content model
- Layout and presentation for text and images
In this article, we'll introduce these features through a series of related examples from a hypothetical health inspection application. More advanced topics�including events, variables, timers, and history�will be covered in the third article of the series, Wireless Markup Language�Beyond the Basics.
A Note on XML
WML has its roots in HDML (Unwired Planet's Handheld Device Markup Language), which itself is based on HTML. However, WML has been defined using Extensible Markup Language (XML); familiarity with XML is very useful when writing WML. What this means for the developer is that WML markup requirements are much more strict than those placed on an HTML developer. Attention to case (e.g., <deck> is not the same as <DECK>), correct pairing of tags, and use of an XML prologue are required; incorrect WML will not be displayed by wireless devices! For further information on XML, please refer to www.oasis-open.org. In addition, Robin Cover's XML pages are an excellent resource for XML tutorials and tools.
WML uses a deck and card model for content display and navigation. Wireless users receive a WML deck consisting of one or more cards. Each deck is a self-contained unit, allowing a user to work offline between deck requests. A card is intended to represent a single physical display screen. To define a deck, a pair of a <wml></wml> tag set is used that contains one or more cards delimited by <card></card>.
A Simple WML deck
Note the first two lines that precede the
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "//WAPFORUM//DTD WML1.1//EN" "">http://www.wapforum.org/DTD/wml13.dtd"> <wml> <card> <p>Health Inspection</p> </card> </wml>
To read more of this tip, click here .