XHTML MP Document Structure


Hello World XHTML MP Example


<?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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.