Index

Example: Generate a grid of results

In the example, a grid is generated. The first rule matches containers and generates a row for each of the five animal classes. The animal class is given a bold label using the header style class. The second rule generates a label for each leaf node. The labels are placed inside the container's element with the uri attribute, which here is the row. The result is a set of labels in one row. Note that only one grid column was declared. Since there are more results than columns, the grid will add columns internally to display the extra cells properly.

View   View Data Source

<grid>
  <columns>
    <column/>
  </columns>
  <rows datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/all-animals">
    <template>
      <rule iscontainer="true">
        <row uri="rdf:*">
          <label class="header" value="rdf:http://www.some-fictitious-zoo.com/rdf#name"/>
        </row>
      </rule>
      <rule>
        <label uri="rdf:*" value="rdf:http://www.some-fictitious-zoo.com/rdf#name"/>
      </rule>
    </template>
  </rows>
</grid>
Copyright © 1999 - 2005 XULPlanet.com