XHTML MP Document Structure


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.


(helloWorldEg1.xhtml)

<?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">
  <head>
    <title>XHTML MP Tutorial</title>
  </head>

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


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.


Page 8 of 36 Previous Page | Next Page
Contents at a Glance
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