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: Iterate over the children, dependent on a grandchild
In this example, we attempt to retrieve the 'class' of the Llama. A conditional is used against the grandchild node which restricts results to only the Llama. However, the iteration is done over the child, not the grandchild, as indicated by uri="?child" in the action.
<vbox datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/all-animals">
<template>
<rule>
<conditions>
<content uri="?uri"/>
<member container="?uri" child="?child"/>
<triple subject="?child"
predicate="http://www.some-fictitious-zoo.com/rdf#name"
object="?name"/>
<member container="?child" child="?grandchild"/>
<triple subject="?grandchild"
predicate="http://www.some-fictitious-zoo.com/rdf#name"
object="Llama"/>
</conditions>
<action>
<label uri="?child" value="?name"/>
</action>
</rule>
</template>
</vbox>
