O'Reilly logo

Rapid Application Development with Mozilla™ by Nigel McFarlane

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

14.1. An Example Template: Hello, World

Listing 14.1 is a XUL document containing a trivial template that implements “hello, world” one more time.

Listing 14.1. XUL application showing "hello, world" use of template technology.
<?xml version="1.0"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <vbox datasources="test.rdf" ref="urn:test:seqroot">
    <template>
      <label
         uri="rdf:*"
         value="Content: rdf:http://www.example.org/Test#Data"/>
    </template>
  </vbox>

</window>

From the listing, the template system consists of its own tags, like <template>, and special-purpose attributes like ref that are added to other tags. Mozilla provides several syntax options for rules that make up the template query system. In this example, ...

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