O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to the Server

In WML, you can also create forms, which are much like HTML forms. The data in a WML form is encoded just as in HTML, so it can be uploaded to CGI scripts (note that not all microbrowsers will support forms).

Here's an example. In this case, I'll ask for user comments and send them back to a CGI script named comments.cgi. To start, I create a <do> element with the label Upload Data, setting its method attribute to "post", and its href attribute to the URI to post to, "http://www.starpowder.com/comments.cgi", just as you might in an HTML form:

 <?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="Uploading"> <p align="center"><b>Uploading</b></p> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required