Index

Example: Recursive tree with two columns

This tree displays two columns, one for the animal name and the other for the number of specimens. A binding is used for the specimens instead of a triple because only the animals have this predicate, not the containers.

View   View Data Source

<tree rows="10" datasources="animals.rdf"
                ref="http://www.some-fictitious-zoo.com/all-animals">
  <treecols>
    <treecol id="name" label="Name" primary="true" flex="1"/>
    <treecol id="specimens" label="Specimens" flex="1"/>
  </treecols>
  <template>
    <rule>
      <conditions>
        <content uri="?uri"/>
        <member container="?uri" child="?animal"/>
        <triple subject="?animal"
                predicate="http://www.some-fictitious-zoo.com/rdf#name"
                object="?name"/>
      </conditions>
      <bindings>
        <binding subject="?animal"
                 predicate="http://www.some-fictitious-zoo.com/rdf#specimens"
                 object="?specimens"/>
      </bindings>
      <action>
        <treechildren flex="1">
          <treeitem uri="?animal">
            <treerow>
              <treecell label="?name"/>
              <treecell label="?specimens"/>
            </treerow>
          </treeitem>
        </treechildren>
      </action>
    </rule>
  </template>
</tree>
Copyright © 1999 - 2005 XULPlanet.com