7. XHTML MP Document Structure

7.1. Hello World XHTML MP Example

Preferences - Do not show ads

Here is our first XHTML MP example. It shows the structure of a typical XHTML MP document.


<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <title>XHTML MP Tutorial</title>

    <p>Hello world. Welcome to our XHTML MP tutorial.</p>

This is what you will see in some mobile phone emulators:

Sony Ericsson T610

Nokia Mobile Browser 4.0

XHTML MP documents start with the prolog, which contains the XML declaration and DOCTYPE declaration.

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

The prolog components are not XHTML MP elements and they should not be closed, i.e. you should not give them an end tag or finish them with />.

The rest of the document is the same as an ordinary HTML document, except that there should be no xmlns attribute for the <html> tag in HTML.

XHTML MP documents must contain the <html>, <head>, <title>, and <body> elements.

Previous Page Page 8 of 36 Next Page

Contents at a Glance (Click Here for Full Table of Contents)
Print this Web Page | | Back to Top

Feedback Form (Expand)

What do you think about this web page?

XHTML MP Tutorial Table of Contents XHTML MP Tutorial Contents at a Glance Preferences - Change Color Scheme Preferences - Do Not Show Ads Previous Page Next Page