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

Elements

An alternative way of thinking about these extra slashes is to think in terms of elements.[5] An element takes one of two forms: either a start-tag and an end-tag (whose types must match):

<tag> . . . </tag>

or a single empty-element tag (complete with extra slash):

<tag/>

Note that there is exactly one slash per element.

An element can contain other elements (either matched pairs or empty-element tags), possibly mixed up with flow text. Looking at Example 1.2 this way, there is a single <wml> element (as a matched pair <wml> </wml>), containing a single <card> element (as a matched pair <card> </card>), containing a single <p> element (also as a matched pair, <p> </p>), which in turn contains a single <img> element (as the empty-element tag <img/>).

It’s important to ensure the tags match properly. Mismatching tags such as:

<x>...<y>...</x>...</y>

is an error and will prevent the page from being displayed. This should have been written as:

<x>...<y>...</y>...</x>


[5] Looking at the document in terms of elements also comes from XML.

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