Page 188 - DCAP512_WAP_AND_WML
P. 188
WAP & WML
Notes
Notes An HTML writer does not worry about screen or display boundaries. Instead, the
Web browser manages issues relating to the screen boundaries. But a WML writer must be
aware of screen boundaries of WAP devices when writing code for cards.
WML Syntax
WML supports a tag-based syntax just like HTML. Many tags with the same name can be found
in both languages, although the behavior of these tags may differ:
<a>
<img>
<input>
<p>
<select>
WML attempts to improve on the inconsistent syntax seen in much of today’s HTML. WML
generally requires stricter conformance to standards — specifically the inclusion of end-tags or
closed empty-element tags. For example, the <p> tag must always be followed by a matching </
p> tag (or else the page will not display). Tags without a matching end tag, such as br, must
incorporate the ending slash as follows:
<br/>
Because WML is a subset of XML designed for XML parsers, the top of every WML page includes
the following header information to specify the Document Type Description (DTD):
<?xml version=”1.0">
<!DOCTYPE wml PUBLIC
“-//WAPFORUM//DTD WML 1.1//EN”
“http://www.wapforum.org/DTD/wml_1.1.xml”>
WML Cards and Decks
The most apparent difference between WML and HTML source files is the concept of WML cards
and the <card> tag. Cards effectively implement multiple WML screens within a single page.
WAP browsers display only one card at a time, but they load a page file (called a deck) that
contains multiple cards in one transaction.
Loading multiple cards at once caches potential screen views locally on the WAP browser to
reduce the need for network requests. In addition, one network request to fetch a file the size of
a typical HTML page will generally execute faster than a series of requests for much smaller
pieces of the file. In these ways, WAP’s implementation of cards and desks is a clever optimization
of the limited bandwidth on today’s wireless networks.
Did u know? What are the Advantages of WML?
Like HTML, WML is easy to use. However, compared to HTML, WML has the following
advantages in the context of wireless:
182 LOVELY PROFESSIONAL UNIVERSITY