WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

Index

Example: Iterate over elements based on type

This template iterates over the animals, but filters containers using their type instead of the iscontainer attribute. The first triple uses the rdf type predicate to get all of nodes that are animal classes. The second rule will match all animals.

View   View Data Source

<vbox datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/all-animals">
  <template>
    <rule>
      <conditions>
          <content uri="?uri"/>
          <member container="?uri" child="?animal"/>
          <triple subject="?animal"
                  predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
                  object="http://www.some-fictitious-zoo.com/rdf#Class"/>
          <triple subject="?animal"
                  predicate="http://www.some-fictitious-zoo.com/rdf#name"
                  object="?name"/>
      </conditions>
      <action>
        <hbox uri="?animal">
          <label class="header" value="?name"/>
        </hbox>
      </action>
    </rule>
    <rule>
      <button uri="rdf:*" label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/>
    </rule>
  </template>
</vbox>