


XHTML-MP Style Guide Chapter 1 - History of XHTML Mobile Profile

By Luca Passani
XHTML Mobile Profile 1.0 is the official mark-up language of WAP 2.0 created by the Open Mobile Alliance (OMA) (formerly the WAPForum). The goal in creating this specification was to converge the mark-up language for wireless devices with the one used for the World Wide Web. XHTML MP may appear like a return to the basics, but on closer inspection it is more complex. XHTML MP is the last of a series of mark-up languages for wireless development, evolving over the past decade with varying degrees of success.
This chapter gives a quick history of mark-ups over the years. Please refer to Figure 1 for an overview of all wireless mark-ups and how they relate to one another.
HDML and the advent of WAP 1.X and WML
WAP was the first attempt to create a universal standard for wireless development.
Back in 1994 Openwave (then called Unwired Planet) possessed the technology to bring the Internet to mobile devices. The mark-up language for wireless development was called HDML (Handheld Device Mark-up Language). While inspired by HTML, HDML contained new features to program a mobile phone UI (softkeys, numeric keyboard) and make best use of scarce wireless bandwidth (client-side variables, deck/card metaphor).
While HDML fulfilled its task, Openwave and other players in wireless (Nokia, Ericsson and Motorola) along with the major wireless operators (specifically AT&T Wireless) felt it was time to come up with a global standard. This led to the creation of the WAP Forum and WAP. Since a unique company owned HDML, it was decided that it could not be directly adopted as the mark-up language for the WAP standards. Openwave donated the intellectual property behind HDML to the WAP Forum, and the standards body created WML out of it along with markup languages being used by Ericsson and Nokia at the time. WML served the industry need for a new open mark-up, which would retain the power to address the specific needs of mobile device programming. In 1999 WML was born.

Figure 1: History of Wireless mark-up languages
WML 1.X
As the first truly global wireless mark-up language, WML has been popular since its introduction in 1999. It retained almost all the features of HDML along with some additional features such as timers. Still today, the great majority of wireless sites are built with WML. Even theWAP 2.0 specifications mandate backward compatibility by demanding that WAP 2.0 phones support WML 1.X in addition to XHTML MP.
WML was suited to build application for devices with small screens. One disadvantage was the requirement for developers to learn a language that was somewhat different from HTML, the language at the foundation of the World Wide Web. For this reason, some carriers and phone manufacturers inside the WAP forum felt that the wireless mark-up should evolve in the direction of HTML to make developers' lives easier (and development more economical). Simplifying somewhat the situation, it could be said that:
WML had the advantage of facilitating the creation of more usable applications, at the cost of increased complexity and cost for developers. HTML would lead to less usable applications, but would restate the continuity between Web and Wireless
After many years of discussion about convergence with the W3C specifications for the wired web, the WAP Forum introduced XHTML MP and the discontinuation of WML 1.X. The convergence to the big web had been realized. with a cost of the loss of some usability-related functionalities, which are expected to become less important as devices become more capable.From HTML to XHTML Mobile Profile
So far we have used the names HTML and XHTML MP sort of interchangeably. Let's look at what relationship exists between the two.
Once the move to HTML was decided, there was a not so little detail to solve: which HTML? The HTML we see on the web today is not really a standard. Over the years HTML has come to be defined as the intersection of tags which behave more or less supported on the most popular browsers (Microsoft Internet Explorer and Netscape Navigator). Some developers refer familiarly to this 'version' of HTML as tag soup.
Tag soup was obviously not a good candidate to be a wireless mark-up. For this reason, the WAP forum turned to W3C and looked for a better candidate. To understand how XHTML MP was chosen, we need to take a step back and look at the evolution of HTML.
Over the years, W3C tried to capture the definition of the tags in the tag soup and turn them into a recommendation. This proper formalization of what was just current practice led to the definition of HTML 2.0, HTML 3.2 and HTML 4.0 (December 1997). By the time of the HTML 4.0 recommendation, XML (and XML hype) was taking the world by storm, and the "xmlification" of HTML became the logical next stepThis happened with the introduction of XHTML 1.0 (January 2000).
XHTML 1.0
www.w3.org/TR/xhtml1
The next step taken by W3C was to modularize the elements and attributes into convenient collections for use in documents that combine XHTML with other tag sets. The modules are defined in Modularization of XHTML (http://www.w3.org/MarkUp/#xhtml-modularization). While the goal of the modularization effort was to prepare the ground for future extensions to XHTML, one of the most important results was, rather ironically, XHTML Basic, which is in fact just a subset of XHTML 1.0. The purpose of XHML Basic was to define a stripped down version of XHTML for devices with limited capabilities (mobile phones, televisions, PDAs, vending machines, smart watches to name just a few) directly from the XHTML basic specs:
www.w3.org/TR/xhtml-basic/
XHTML Basic is good old HTML without the features that are hard to support on the devices mentioned above: frames, nested tables, CSS, complex forms and scripting (JavaScript).
Back to the WAP Forum and the choice of HTML, the decision was to take XHTML Basic as a starting point and add some styling information (style attribute and tag plus WCSS) in addition to a handful of style tags belonging to other XHTML 1.0 modules such as hr, b, i, big and small. XHTML MP was born (October 2001).
XHTML Mobile Profile Specifications
www.wapforum.org/tech/documents/WAP-277-XHTMLMP-20011029-a.pdf
One quick note about Compact HTML (cHTML)
It is worth mentioning that another HTML derivate, Compact HTML (also known as cHTML) has been popular (particularly in Japan where it is used for iMode). The specification of cHTML is owned by NTT DoCoMo, who is a member of the WAP Forum (now OMA) and they have announced the intention of a cHTML into convergence with XHTML too.
XHTML MP Syntax
Let's look more closely at XHTML MP in terms of syntax. Familiarity with HTML and XML are an advantage for understanding the rest of this user guide.
XHTML MP MIME Media Type
MIME types constitute the technical foundation for the multimedia capabilities of the World Wide Web and all of the Internet services in general. If you are not familiar with the concepts behind MIME types, please refer to this document: www.webopedia.com/TERM/M/MIME.html
The MIME media type for XHTML Mobile Profile is application/vnd.wap.xhtml+xml. It is not essential for XHTML Mobile Profile documents to be associated with application/vnd.wap.xhtml+xml media type. Good old text/html may be used instead.
W3C and OMA would like you to use the new MIME type in order to programmatically distinguish XHTML MP content from other kinds of HTML. On the other hand, text/html is the default MIME type for the web and forcing developers to use another MIME type would contradict the objective of facilitating convergence between wireless and Web. In addition, using a MIME type other than text/html would make it hard to preview XHTML MP content with a plain PC web browser.
XHTML-MP documents must be well-formed
This requirement is inherited by XML. Assuming you are not familiar with the concept of "well-formed" (unlikely for a developer nowadays), here is the concept in a nutshell.
To be well formed a document needs to comply with the following rules:
It contains a root element (
So, single <html> in the case of XHTML MP) All other elements are children of the root element All elements are correctly paired The element name in a start-tag and an end-tag are exactly the same Attribute names are used only once within the same element Attribute values need to be enclosed in quotes (either `single' or "double")<p> tags, <br> tags without a trailing slash and other non closed aberrations from the tag soup era are not welcome anymore (which does not necessarily mean that you'll get an error, as we will see in the next chapter).XHTML MP Document Type Definition (DTD)
Using XML terminology, XHTML MP is an XML application. In short, this means two things.
XHTML MP follows the XML syntactical rules that make it well-formed (see previous paragraph)
XHTML MP tags and nesting follow a well defined set of rules (grammar) defined by the Document Type Definition for XHTML-MP.
If you are not familiar with XML and DTDs, one of the many tutorials available on the Internet can get you started:
www.w3schools.com/xml/default.asp
For the purpose of this document, you need to know that a DTD is a document that defines which tags and attribute are legal for a given document and how those tags can be legitimately combined together.
A valid XML document needs to specify the DTD which tells XML-based application how to parse the document and make sure it is syntactically correct. This means that the proper way to build an XHTML MP document is by having the following lines at the very top:
<?xml version="1.0" charset="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
The first line is the XML processing instruction which simply means "this is an XML file," and the contents are in the iso-8859-1 character set. The second line is the DTD declaration that tells a validating parser where it can find the grammar rules in the unlikely event it wants to check the document its rules.In practice, validation of XHTML hardly makes sense for a variety of reasons. Adding these lines at the top of each document doesn't hurt, and your conscience will remain clean.
To be complete, we should also mention the existence of a different DTD which represents a superset of the OMA definition:
<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML Mobile 1.0//EN"
"http://www.openwave.com/dtd/xhtml-mobile10.dtd">
This DTD should be used when you want your XML tools to be able to validate an XHTML MP containing certain tags and attributes that are only supported by the Openwave browser. These extensions (described later in the style guide) were introduced to bring back some WML functionality which was lost in XHTML MP.Families of Tags
Let's take a brief look at the XHTML MP tags organized by the XHTML modules that contain them. The first table represents the XHTML Basic modules and the tags and attributes that belong to the respective modules.
Module Element
Structure body,head,html,title
Text dfn,div,em,h1,h2,h3,h4,h5,h6,kbd,p,pre,q,samp,span,strong,var
Hypertext a
List dl,dt,dd,ol,ul,li
Basic forms form,input,label,select,option,textarea
Basic tables caption,table,td,th,tr
Image img
Object object,param
Meta information meta
Link link
Base base
The following table shows the extra tags that are not part of XHTML Basic, but nonetheless were introduced into XHTML MP. These tags were chosen among the existing XHTML 1.0 modules.
Module Element/Attributes
Forms fieldset,optgroup
Legacy start attribute on ol,
value attribute on li
value attribute on li
Presentation b,big,hr,i,small
Style sheet style element
Style attribute style attribute
Cascading Style Sheets (CSS)
Thanks to the style attribute and tag, XHTML Mobile Profile allows the use of style elements. Browsers that support style sheets with XHTML Mobile Profile documents, do so by supporting WAP CSS, a mandatory feature of the WAP 2.0 specs. Styling an XHTML Mobile Profile document can be done either by using external style sheets, internal style information, or inline styling.
To associate an external CSS style in an XHTML Mobile Profile document, the following syntax can be used:
<head>
<link href="mystyle.css" type="text/css" rel="stylesheet"/>
...
</head>
Styling information can also be included in the document itself through the style element, as shown by this example:
<head>
<style type="text/css">
p { text-align: center}
</style>
...
</head>
It is also possible to apply styles to a tag directly, thanks to the style attribute.<p style="text-align: center">...</p>Of course, if you are familiar with web development, this is all deja-vu.
One quick note about WML 2.0
As far as you are concerned, WML 2.0 does not exist and has never existed. We only mention it here for background information.
WML 2.0 was an attempt at merging WML and XHTML Basic before the WAP 2.0 spec was finalized. It was eventually discarded. Telephone manufacturers can support it silently inside their browsers as a possible way to transition to XHTML MP through automatic translation, but the WAP Forum clearly states that such a mark-up is not meant for developers. If you come across the term, be aware that WML 2.0 is not something you as a developer need to care about.
What comes next?
Now that we've learned how the XHTML Mobile Profile evolved from previous markup languages, we will focus on some of the most effective ways to build mobile applications, leveraging the features and minding the limitations of XHTML-MP.
XHTML-MP Style Guide Chapters
XHTML-MP Style Guide Index
1. History of XHTML Mobile Profile
2. XHTML MP in practice
3. Menus in XHTML Mobile profile 1.0
4. Text-flow
5. Forms: Collecting User Data
6. Images and Objects
7. Testing Your Applications
Appendix A
Appendix B
![[image]](http://mowser.com/img?url=http%3A%2F%2Fdeveloper.openwave.com%2Fgraphics%2Fglobal%2Fspacer.gif)
Copyright © 2000-2008 Openwave Systems Inc. About Us | Openwave | Terms & Conditions | Privacy Policy | Update Profile![[image]](http://mowser.com/img?url=http%3A%2F%2Fdeveloper.openwave.com%2Fgraphics%2Fglobal%2Fspacer.gif)









