Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

Select Elements

Like HTML, WML supports a <select> element to display a select control (which is like a drop-down list box). As an example, I'll create a select control here. After the user has made a selection, he can click a Read Selection <do> element, which will navigate to a new card that displays the selection they've made.

I start by creating the select control and giving it the name "selection":

<?xml version="1.0"?> 
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 2.0//EN"
    "http://www.wapforum.org/dtd/wml20.dtd" >
<wml>
    <card id="Card1" title="Select">
        <p align="center"><b>Select</b></p>
        <select name="selection">
					.
					.
					.
					</select>
				

As in HTML, you specify the items in the select control with <option> elements:

 <?xml version="1.0"?> <!DOCTYPE ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book