01 logo

Wireless markup language (WML)

Wireless markup language

By Dhruv PatelPublished 3 years ago 6 min read
Wireless markup language (WML)
Photo by Jackson Sophat on Unsplash

An XML-based document description language for producing content and user interfaces for WAP-enabled narrow-band devices like cellphones and pagers.

WML was the first WAP language and is often used interchangeably with WAP 1.0. Given how quickly technology advances and new mobile phones are introduced to the market, no mobile phones in use today are incapable of handling XHTML or WAP 2.0, though they are still backward compatible with WAP 1.0. Indeed, many businesses have begun to ditch WAP 1.0 in favor of WAP 2.0, which is XHTML ME! So the decision to implement WML in your mobile application is entirely up to you.

WML employs the notions of decks and cards. A deck is a document that may be divided into smaller sections. One of these tiny bits of content that is shown on the mobile device is a card. A deck is a collection of Web sites if you think of it that way (the cards). When a mobile device requests access to a WML document, the collection (the deck) is returned all at once. Rather than making several calls to the server for individual pages (the cards), navigating within the deck is accomplished by utilizing the deck that is already in memory. WML may also communicate variables between cards in a deck based on their picks.

This does not exclude the request for more decks. A card can contain connections to resources that are not already in the deck. When you click on one of these links, the mobile device fetches the WML and loads the new deck. Wireless connections were notoriously poor back in the day. The objective was to deliver as much data to the device as possible at once in order to minimize the number of times a remote connection was required.

Features of WML

WML provides information on how text and images might be delivered to the user. The final presentation is determined by the user. Pictures must be in WBMP format and in monochrome.

WML supports many input components such as password entry, choice selectors, and text entry controls. The user has the option of using a keyboard or voice input.

WML provides hyperlink navigation as well as browsing history.

Context Management: The state may be shared across decks and stored across decks.

WML Decks and Cards

The basic unit of navigation in HTML is a page, but in WML it is a card. A WML file can include many cards that together create a deck.

When a WML page is accessed via a mobile phone, the WAP server downloads all of the cards on the page. As a result, if the user moves to another card in the same deck, the mobile browser does not need to query the server because the deck has already been saved in the wireless device's file.

A card can include links, text, photos, input forms, choice boxes, and a variety of other components.

WML-structure

WMLScript is the static client-side scripting language of WML in Wireless Application Protocol (WAP). It is comparable to JavaScript. It is a compiled language that has been optimized for low-power devices. WMLScript standard libraries include Lang, Float, String, URL, WML Browser, Dialog, and WMLScript Crypto Library.

<?XML version="1.0"?>

<!DOCTYPE PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"

"http://www.XYZ.org/DTD/wml12.dtd">

<wml>

<head>

<!-- (optional) head section -->

</head>

<template>

<!-- (optional) template section -->

</template>

<card id="card1" title="my card">

<!-- Card 1 -->

</card>

<card id="card2">

<!-- Card 2 →

</card>

</wml>

The document is identified as an XML document by the first line of code. The DTD for WML version 1.2 is used in the DOCTYPE declaration that follows at line 2. These two XML elements are required and exist in every WML document:

The root element for WML documents is wml>. According to the XML specification, each document must have just one root element. As a result, wml> denotes a deck.

card> specifies a card from the WML deck. The parameter ID gives the card a unique name. This name can be used subsequently to refer to certain cards in the deck, such as when referring to a special card. The parameter title is also optional; if set, the given text shows above the content in most WAP browsers.

WML versions

WAP Forum has launched WAP 2.0. The markup language defined in WAP 2.0 is XHTML Mobile Profile (MP). WML MP is a subset of XHTML. Along with XHTML MP, a style sheet named WCSS (WAP CSS) has been released. The WCSS is a subset of CSS2.

The majority of new mobile phone devices are WAP 2.0 capable. Because WAP 2.0 is backward compatible with WAP 1. x, WAP 2.0-enabled mobile devices can display both XHTML MP and WML documents.

WML 1. x is an older technology. However, this does not imply it is obsolete since many wireless devices that only support WML 1. x are still in use. WML 2.0 is the most recent version, and it is designed for backward compatibility. As a result, WAP site developers do not need to be concerned about WML 2.0.

Comparison with HTML

WML is exclusively used for WAP sites on mobile phones, and it can only be hosted by WAP hosts that support WML. HTML may be served on any type of web server.

Unlike HTML webpages, WML sites are monochromatic.

Coding is comparable in many ways, however, a poorly coded WAP site will not run as well as a poorly constructed HTML one.

When compared to the more forgiving HTML code, all WML tags must be closed.

There are no alignment tags in WML like there are in HTML. Instead,

In order to align text in WML, it must be utilized.

WML only supports monochrome photos in WBMP format, but HTML does not.

Advantages of WML

WML is a simple markup language that is simple to learn.

WML is a mandatory component of the WAP standard.

WML enables the developer to design the user interface that will appear on the mobile device's screen.

The developer may quickly design the type of content displayed on the mobile device screen, such as text, links, photos, data entry forms, and selection lists, using the relevant WML tag.

The WTA (Wireless Telephony Application) Libraries provide support for WML and WMLScript. These public libraries enable developers to include telephony capabilities in their applications.

Disadvantages of WML

Large decks will not be accepted by WAP devices such as WAP phones.

Most phones have extremely limited memory and very basic CPUs, as well as small displays and tiny keypads.

You will never be able to build a successful WAP service if your WML pages are crammed with beautiful graphics and content.

Problems that a Web Application May Face When Used in a Mobile and Wireless Environment

HTTP

HTTP was not designed with low bandwidth and high latency connections in mind. Because HTTP is uncompressed and stateless, HTTP protocol headers are big and redundant.

Content providers block caching because client organizations cannot receive feedback if a cache is established between a server and a client. Because HTTP is stateless, users suffer from constantly downloading the same material from the server.

Sending material from a client to a server can cause further issues if the client is currently disconnected.

HTML

HTML was created to be used in writing content for World Wide Web web pages (www). Initially, it was intended primarily for desktop use. As a result, when employed in hand-held devices, the following issues arise:

The display is small and has poor resolution.

User Interfaces are restricted.

CPU with a low-performance level.

Conclusion

Even though this session was lengthy and detailed, it only scratched the surface of WML. You can't call yourself a WML specialist just yet, but the most difficult aspect - determining a starting point — is now complete. You now understand how to design a simple campaign and are familiar with many of the capabilities available in WML.

Studying the WML code of other add-ons is one of the greatest ways to learn more about WML (and one of the only methods before this guide).

tech news

About the Creator

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2026 Creatd, Inc. All Rights Reserved.