Skip to content

Instantly share code, notes, and snippets.

View dmccreary's full-sized avatar

Dan McCreary dmccreary

View GitHub Profile
@dmccreary
dmccreary / xforms-income-expense-totals
Last active August 23, 2017 19:23
Example of using Orbeon forms to create a spreadsheet like behavior to correctly calculate sums and differences even when nulls are present.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
<title>Sample Annual Income and Expenses Report in Table</title>
<xf:model>
<xs:schema>
<xs:simpleType name="decimalOrNull">
<xs:restriction base="listOfDecimals">
<xs:maxLength value="1"/>
</xs:restriction>
</xs:simpleType>