Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here is an example that does some similar grouping to output the following:</p> <ul> <li>May 2011 <ul> <li>2011-05-10: Homer</li> <li>2011-05-09: Lisa</li> </ul></li> <li>April 2011 <ul> <li>2011-04-07: Bart</li> <li>2011-04-05: Bart</li> <li>2011-04-02: Lisa </li> </ul></li> </ul> <p>It is not exactly what you have in your screenshot, but should give you a good enough idea of how to do this grouping.</p> <pre><code>&lt;xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fr="http://orbeon.org/oxf/xml/form-runner"&gt; &lt;xhtml:head&gt; &lt;xhtml:title&gt;Timesheet&lt;/xhtml:title&gt; &lt;xforms:model&gt; &lt;xforms:instance&gt; &lt;instance&gt; &lt;entry&gt; &lt;start&gt;2011-05-10&lt;/start&gt; &lt;person&gt;Homer&lt;/person&gt; &lt;/entry&gt; &lt;entry&gt; &lt;start&gt;2011-05-09&lt;/start&gt; &lt;person&gt;Lisa&lt;/person&gt; &lt;/entry&gt; &lt;entry&gt; &lt;start&gt;2011-04-07&lt;/start&gt; &lt;person&gt;Bart&lt;/person&gt; &lt;/entry&gt; &lt;entry&gt; &lt;start&gt;2011-04-05&lt;/start&gt; &lt;person&gt;Bart&lt;/person&gt; &lt;/entry&gt; &lt;entry&gt; &lt;start&gt;2011-04-02&lt;/start&gt; &lt;person&gt;Lisa&lt;/person&gt; &lt;/entry&gt; &lt;/instance&gt; &lt;/xforms:instance&gt; &lt;/xforms:model&gt; &lt;xhtml:style type="text/css"&gt; .xforms-repeat-selected-item-1, .xforms-repeat-selected-item-2 { background: transparent } &lt;/xhtml:style&gt; &lt;/xhtml:head&gt; &lt;xhtml:body&gt; &lt;xxforms:variable name="entries" select="entry"/&gt; &lt;xxforms:variable name="months" select="distinct-values($entries/start/substring(., 1, 7))"/&gt; &lt;xhtml:ul&gt; &lt;xforms:repeat nodeset="$months"&gt; &lt;xxforms:variable name="current-month" select="."/&gt; &lt;xhtml:li&gt; &lt;xforms:output value="format-date(xs:date(concat(., '-01')), '[MNn] [Y]')"/&gt; &lt;xhtml:ul&gt; &lt;xforms:repeat nodeset="$entries[substring(start, 1, 7) = $current-month]"&gt; &lt;xhtml:li&gt; &lt;xforms:output ref="start"/&gt;: &lt;xforms:output ref="person"/&gt; &lt;/xhtml:li&gt; &lt;/xforms:repeat&gt; &lt;/xhtml:ul&gt; &lt;/xhtml:li&gt; &lt;/xforms:repeat&gt; &lt;/xhtml:ul&gt; &lt;/xhtml:body&gt; &lt;/xhtml:html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload