WML Structure

Cards, decks and memory limits.

WML is a standard vocabulary of XML - the DTD is pre-defined by the WAPForum and all WML documents must match the same DOCTYPE. Make sure that you use only WML tags in WML documents, if you make a mistake, the underlying XML will not be well formed and the WML document will be invalid. Unlike HTML, WAP Gateways will not load an invalid document and because mobile phones do not have the error checking capability of IE5 there will be no browser error given either. The user may just get a blank screen or a cryptic WAP Gateway error message. You must validate ALL your WML documents before uploading them to a website, using a variety of tools. The quickest and most helpful initial check is in an XML editor, which can report errors of structure. Further checks can be made using WAP Toolkits, addressed later

All WML documents must begin with the same DOCTYPE declaration and must all use <wml> as the top level tag:


All WML documents need at least one card. If you keep the card contents small enough, you can use multiple cards to form a deck. This will improve the speed of your site by reducing the number of server requests (or NRT - Network Round-Trips) required. With all WML documents, your primary concern must be the limited capability of the browser. Your WML documents will be served via a WAP gateway that verifies the WML and compiles the cards into binary data. If this binary data exceeds a certain size (about 1500bytes) the WML file can be rejected by the gateway - in order to not exceed the limited memory capacity of the browser unit. Some Toolkit programs give an indication of the final bytecode size but the actual limit can vary between gateways so you must make each WML document as small as possible.

Remember, the browser is a mobile phone, not a PC. There may as little as 3kb of memory available for your WML document (in it's uncompiled form).

This is part of www.codehelp.co.uk Copyright © 1998-2004 Neil Williams
See the file about.html for copying conditions.