WML

One of the XML applications that has been getting a lot of attention there days is WML. WML and its associated protocol, the WAP, are targeted at handheld devices such as cellular phones, PDAs, and other devices with restricted hardware capabilities. WML represents a limited-syntax language that's relatively easy to implement for such devices. The programs that use WML in those devices are often called microbrowsers .

Here are some WML resources:

  • www.wapforum.org A great resource for all things WML. Acts as a clearinghouse for information. The WAP Forum was consolidated with the Open Mobile Architecture Initiative to form the Open Mobile Alliance Ltd, whose home page is at www.openmobilealliance.org. As of this writing, however, the WAP Forum site is still available.

  • www.apachesoftware.com All about Klondike, a popular WML browser.

  • www.apachesoftware.com/wml/wmldemo.wml Klondike WML examples.

  • http://www.zvon.org/xxl/WMLTutorial/Output/introduction.html A WML tutorial.

  • http://www.wirelessdevnet.com/channels/wap/training/wml.html Another WML tutorial.

  • http://www.wapforum.org/DTD/wml20-flat.dtd The WML 2.0 (the current version) DTD. A great place to check to resolve syntax questions.

  • http://updev.phone.com Openwave's WML SDK, which includes a browser.

You can find the WML 2.0 elements in Table 20-3. You'll find links to the various sections of the WML DTD at http://www.wapforum.org/what/technical.htm, and you can view the whole DTD as one file in http://www.wapforum.org/DTD/wml20-flat.dtd. If you want to check on WML elements or see what attributes an element has, http://www.wapforum.org/DTD/wml20-flat.dtd is a good resource.

Table 20-3. WML 2.0 Elements
Element Function
a Hyperlink
abbr Abbreviation
access Access element
acronym Acronym
address Addresses
anchor Creates an anchor
b Bold
base Base
big Big text
blockquote Block quotes
br Line break
caption Table caption
card Creates a card
cite Citations
code Code text
dd Definition description
dfn Definitions
div DIV sections
dl Definition list
do Do element
dt Definition term
em Emphasized
fieldset Field set
form Creates a form
getvar Get variable
go Navigates
h1 h6 Headings
head Head section
hr Horizontal rule
i Italic
img Handles images
input Text field
kbd Keyboard text
label Label
li List item
link Link
meta Holds metadata
noop No operation
object Object
ol Ordered list
onevent Handles an event
optgroup Creates an option group
option Creates an option
p Paragraph
param Parameter
postfield Post field data
pre Preformatted text
prev Move to previous card
q Quote
refresh Handles refreshes
samp Sample text
select Select control
setvar Sets a variable
small Small text
span Spans text
strong Strong
style Style
sub Subscript
sup Superscript
table Creates a table
td Table cell data
template Template
textarea Text area
timer Creates a timer
title Title
tr Table row
tt Teletype text
u Underlined
ul Unordered list
var Variables

In addition, WML supports these character entities:

  • & is an ampersand ( & ).

  • ' is an apostrophe ( ' ).

  • > is the greater-than symbol ( > ).

  • &lt; is the less-than symbol ( < ).

  • &nbsp; is a nonbreaking space ( ).

  • &quot; is a quotation mark ( " ).

  • &shy; is a soft hyphen ( _ ).

In this chapter, I'll use the popular Apache Klondike WML browser, which you can download for free from links at www.apachesoftware.com. It's a well-designed browser; if you want to follow along, I encourage you to install it.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net