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, ...

Get Rapid Application Development with Mozilla™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.