110 likes | 350 Views
WAP’s WML by David Boncarosky. WML Inherits From XML WML Extends Interactivity to Cell Phones, Pagers, PDAs Display Varies Widely From Device to Device WML tags lack consistency across different manufacturers. WML Coding.
E N D
WAP’s WMLby David Boncarosky • WML Inherits From XML • WML Extends Interactivity to Cell Phones, Pagers, PDAs • Display Varies Widely From Device to Device • WML tags lack consistency across different manufacturers
WML Coding • WML Based on a Deck of Cards -- the device only shows 1 card at a time • Cards in a Deck can Interact with other Cards in Deck and Cards in External Decks
WML Coding • All WML documents MUST have a specific header • The Deck is delimited by the <wml> . . . </wml> tag <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <card id="main" title="First Example"> <p>Hello World!</p></card> </wml>
Entering Text • Cards are delimited by the <card> . . . </card> tags • All Text within a card must be placed in <p> . . . </p> tags <wml> <card id="main" title="Hello World"> <p> My First WML Card! (a.k.a. Hello World!) </p> </card> </wml>
WML Anchors (links) • Similar to HTML links • <a href=“address”> text </a> • Use # to reference a card (e.g. href = “#myCard”). Otherwise, will go to the first card in a deck <wml> <card id="main" title=“Link Example"> <p> <a href="#anotherCard"> My First link </a> </p> </card> </wml>
WML sample Site <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <template> <do type="accept" label="Find a Person"> <go href="#search" /> </do> <do type="accept" label="School Info"> <go href="#schools" /> </do> <do type="accept" label="My CMU email"> <go href="#login" /> </do> </template>
WML sample site (cont.) <card id="main" title="Welcome to CMU"> <p> Welcome to CMU <br/> <a href="#search">Find a Person</a> <br/> <a href="#schools">School Info</a> <br/> <a href="#login">My CMU email</a> </p> </card>
WML Sample Site (cont.) <card id="search" title="Find Someone at CMU"> <p> Find Someone at CMU <br/> First Name: <input name="f_name" /> <br/> Last Name: <input name="l_name" /> </p> <p> <anchor> Submit <go method="post" href="http://www.cmu.edu/search.jsp"> <postfield name="f_name" value="$(f_name)" /> <postfield name="l_name" value="$(l_name)" /> </go> </anchor> </p> </card>
WML Sample Site (cont.) <card id="schools" title="Info on the Schools"> <p> Select the School: <select title="school"> <option>CFA</option> <option>GSIA</option> <option>Heinz</option> <option>HSS</option> <option>MISM</option> </select> <anchor> Get Info <go method="post" href="http://www.cmu.edu/school.jsp"> <postfield name="school" value="$(school)" /> </go> </anchor> </p> </card>
WML Sample Site (cont.) <card id="login" title="Login to Check Mail"> <p> Login to Check eMail <br/> User ID: <input name="user_id" /> <br/> Pass: <input name="passw" /> <br/> <anchor> Login <go method="post" href="http://www.cmu.edu/login.jsp"> <postfield name="user_id" value="$(user_id)" /> <postfield name="passw" value="$(passw)" /> </go> </anchor> </p> </card> </wml>