Wireless Markup Language (WML) Tutorial

Meta Tags

The head Element

The head element contains information about the deck. The head element may contain an access element and/or several meta elements.

The access Element

The access element is used to limit access to the deck, and must be included within the head section if used. By default, WML decks are public. There may only be one access element in a document. The following table shows the attributes used with the access element.

Attributes for the access Element
Attribute Description

domain

The domain of other decks that are able to access cards in the deck. The default value is the domain of the current deck.

path

The root directory of other decks that are able to access cards in the deck. The default value is the root of the domain, "/".

The following declaration states that the deck is only accessible from Juicy Studio, and only from the /wmlpages directory.

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
    <access domain="juicystudio.com" path="/wmlpages"/>
</head>
    <!-- Rest of content here -->
</wml>

The meta Element

The meta element allows you to provide meta data about the deck. Any number of meta elements may be used in the head of the WML document. The following table shows the attributes that may be used with the meta element.

Attributes for the meta Element
Attribute Description

content

This attribute is required, and specifies the meta data for either a http-equiv attribute or the name attribute.

forua

An optional attribute that determines if the property should reach the user agent. The possible values are false, and true. If the value is set to true, it must be sent to the user agent.

http-equiv

Equivalent of HTTP headers. Each meta element must contain either a http-equiv attribute or a name attribute.

name

Used for meta types that have no HTTP equivalent. Each meta element must contain either a name attribute or a http-equiv attribute.

The following meta tag instructs the user agent to expire this page from the cache after 1 day (86,400 seconds).

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
    <meta forua="true" http-equiv="Cache-Control" content="max-age=86400"/>
</head>
    <!-- Rest of content here -->
</wml>

Some devices will not refresh the deck if the deck is navigated to with the prev element. The must-revalidate parameter may be used to override this. The following example prevents the page from being cached.

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<head>
    <meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
    <meta forua="true" http-equiv="Cache-Control" content="no-cache"/>
</head>
    <!-- Rest of content here -->
</wml>

You might also like...

Comments

About the author

Gez Lemon United Kingdom

I'm available for contract work. Please visit Juicify for details.

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.” - E. W. Dijkstra