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.
Example: Match items with a certain parent
Here we want to determine which of Robert's favorite animals are reptiles. There are several ways to do this. In this case, we first get the list of favorite animals, then use a <member> tag to go up to the parent reptile node. We will need to compare to the reptile's name to filter out the non-reptiles since the <member> tag can only use variables.
<vbox datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/humans/robert">
<template>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://www.some-fictitious-zoo.com/rdf#favoriteAnimal"
object="?favoriteAnimal"/>
<member container="?reptiles" child="?favoriteAnimal"/>
<triple subject="?favoriteAnimal"
predicate="http://www.some-fictitious-zoo.com/rdf#name"
object="?name"/>
<triple subject="?reptiles"
predicate="http://www.some-fictitious-zoo.com/rdf#name"
object="Reptiles"/>
</conditions>
<action>
<label uri="?favoriteAnimal" value="?name"/>
</action>
</rule>
</template>
</vbox>
