Also, is it possible to output an HTML table without a tbody element? When
I change my table to this:
<xf:repeat id="repeat-focus" ref="response/group">
<h3>
<xf:output ref="@key"/>
</h3>
<table>
<xf:repeat id="repeat-records" ref="entries">
<tr>
<td>
<xf:output ref="entry[1]"/>
</td>
<td>
<xf:output ref="entry[2]"/>
</td>
</tr>
</xf:repeat>
</table>
</xf:repeat>
I get an error, "TypeError: Cannot read property 'localName' of null at ..."
--Tim
--
Tim A. Thompson
Metadata Librarian
Yale University Library
On Sun, Mar 28, 2021 at 11:01 AM Tim Thompson <[email protected]> wrote:
> Hello, Alain, all,
>
> I have some data that I want to present in a table. The data has one or
> more groups, each with a key and related entries. When I try to iterate
> over the data in xf:repeat, only the data from the first group is being
> output (see screenshot). Sample data and form are below (and attached).
>
> Thanks in advance,
> Tim
>
> Data
> --
> <?xml version="1.0" encoding="UTF-8"?>
> <data xmlns="">
> <response count="544">
> <group key="urn:uuid:8af15476-72c2-45c7-b6eb-9cf5c5faec52" name="Ian
> G. Speden">
> <entries>
> <entry>USA</entry>
> <entry>28489</entry>
> </entries>
> <entries>
> <entry>North America</entry>
> <entry>28489</entry>
> </entries>
> <entries>
> <entry>South Dakota</entry>
> <entry>28445</entry>
> </entries>
> <entries>
> <entry>Dewey County</entry>
> <entry>19301</entry>
> </entries>
> </group>
> <group key="urn:uuid:08e1eead-2687-4a51-a97e-ceb8f9a27fff"
> name="Waage, K. M.; Speden, I. G.">
> <entries>
> <entry>Moreau River, float, conc., SW-facing exposures on ridge
> extending NW from bluffs on Timber Lake Mbr, and about .5 mi W of loc
> C0089, and 2.5 mi WSW of Green Grass</entry>
> <entry>904</entry>
> </entries>
> <entries>
> <entry>Moreau River, float concs., on spur where slump, SW-facing
> exposures on ridge extending NW from bluffs on Timber Lake Mbr, and about
> .5 mi W of loc C0089, and 2.5 mi WSW of Green Grass</entry>
> <entry>894</entry>
> </entries>
> </group>
> </response>
> </data>
>
> Form
> --
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type="text/xsl"
> href="../declarative4all/build/xsl/xsltforms.xsl"?>
> <?xml-model href="http://www.oxygenxml.com/1999/xhtml/xhtml-xforms.nvdl"
> schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="
> http://www.w3.org/2001/xml-events" xmlns:h="http://www.w3.org/1999/xhtml"
> xmlns:sparql="http://www.w3.org/2005/sparql-results#" xmlns:xf="
> http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <head>
> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
> <title>Functional wireframes</title>
> <model id="m" xmlns="http://www.w3.org/2002/xforms">
> <instance id="response" src="sample_data.xml"/>
> </model>
> </head>
> <body>
> <div class="container">
> <xf:group class="count" ref="response[@count]">
> <xf:output value="concat(@count, ' results')"/>
> </xf:group>
> <xf:repeat id="repeat-focus" ref="response/group">
> <h3>
> <xf:output ref="@key"/>
> </h3>
> <table class="table table-striped">
> <tbody>
> <xf:repeat id="repeat-records" ref="entries">
> <tr>
> <td>
> <xf:output ref="entry[1]"/>
> </td>
> <td>
> <xf:output ref="entry[2]"/>
> </td>
> </tr>
> </xf:repeat>
> </tbody>
> </table>
> </xf:repeat>
> </div>
> </body>
> </html>
>
> --
> Tim A. Thompson
> Metadata Librarian
> Yale University Library
>
>
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support