Index

Example: Iterate over the children using a predicate and a triple

In this example, we iterate over a predicate instead of the children of a container. Rather than using the containment attribute, here we just use a <triple>.

View   View Data Source

<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="?child"/>
          <triple subject="?child"
                  predicate="http://www.some-fictitious-zoo.com/rdf#name"
                  object="?name"/>
      </conditions>
      <action>
        <label uri="?child" value="?name"/>
      </action>
    </rule>
  </template>
</vbox>
Copyright © 1999 - 2005 XULPlanet.com