O'Reilly logo

Learning WML, and WMLScript by Martin Frost

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

Chapter 14. WMLScript Pragmas

This chapter discusses the features of WMLScript known as pragmas , which specify meta-information about a WMLScript unit, in a similar way to the <meta> and <access> elements for WML files. (See Chapter 6, for more information on these WML elements.)

You have already encountered one pragma, the url pragma for referencing other WMLScript units, in Chapter 13. In addition, there is an access pragma, corresponding to WML’s <access> element, and a meta pragma, corresponding to the <meta> element. These pragmas are processed by the WAP gateway (see Appendix B) to control the headers sent along with the compiled unit.

All pragmas in a WMLScript file must be specified before any functions. The individual pragmas may be specified in any order, however.

The access Pragma

The access pragma provides the same simple access control as the <access> element does for WML decks. That is, it specifies a domain and path that must match the URL of the caller for a call to be permitted.

There are three forms:

use access domain domain;
use access path path;
use access domain domain path path;

Both domain and path are normal WMLScript string literals. They are interpreted in exactly the same way as the domain and path attributes of WML’s <access> element. (See Chapter 6 for more information.) There may be no more than one access pragma per WMLScript file.

For example, the pragma:

use access domain "wap.net" path "/private";

restricts access to WML and WMLScript that originates ...

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