W3C home > Mailing lists > Public > www-mobile@w3.org > April 2000

Re: wmlscript capabilities

From: Andrew Scott <a.scott@trl.telstra.com.au>
Date: Wed, 19 Apr 2000 10:11:21 +1000
To: Darth Julian <julian@fatdonut.com>
Cc: www-mobile@w3.org
Message-ID: <20000419101120.A9872@brahma.trl.OZ.AU>
On Tue, Apr 18, 2000 at 05:00:46PM -0400, Darth Julian wrote:
> First read of the WMLScript spec seems to indicate that the language has
> no hook into external code beyond calling another wmlscript "compilation
> unit."  If I want to a bit of WMLScript to call a URL (which isn't a
> compilation unit, but, say, a servlet that returns a string), am I out of
> luck?

It sounds like you may have answered your own question.

In your main WMLScript code, put a line

	use url ExternalServletFunction "http://foo.com/servlet/fn1.wmls";

at the top, then later you can do things like:

	x = ExternalServletFunction#myFn();

Which will call the servlet, and get back a string.

The servlet would generate WMLScript itself (not a pure text/plain 
string), and the resulting WMLScript would contain a function called
myFn. For example, the following may be the result of querying the
servlet:

extern function myFn()
{
  return "This is a dynamically generated string";
}

So, as you say, you can't get WMLScript to call anything that doesn't
have a WMLScript-like interface, but you can still access a string 
generated by a servlet.

> /jcb
> 

Andrew Scott .................... http://purl.oclc.org/net/andrewscott/
Telstra Research Labs, Melbourne ......................................
Received on Tuesday, 18 April 2000 20:13:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 6 April 2009 12:59:59 GMT