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: Combine results from two predicate lists

In this example, we get all of the favorite animals of both Sarah and Robert. Remember that only RDF sequences are ordered so we shouldn't rely on the results being returned in any specific order. In the example, two values will be stored in the 'human' variable in the member part of the condition. The first triple will therefore generate the favorite animals of both of them.

View   View Data Source

<vbox datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/humans">
  <template>
    <rule>
      <conditions>
          <content uri="?uri"/>
          <member container="?uri" child="?human"/>
          <triple subject="?human"
                  predicate="http://www.some-fictitious-zoo.com/rdf#favoriteAnimal"
                  object="?favoriteAnimal"/>
          <triple subject="?favoriteAnimal"
                  predicate="http://www.some-fictitious-zoo.com/rdf#name"
                  object="?name"/>
      </conditions>
      <action>
        <label uri="?favoriteAnimal" value="?name"/>
      </action>
    </rule>
  </template>
</vbox>