JSONSchema Forms XForms - sgml/signature GitHub Wiki

    1. Defaults
>In all versions of XForms the state of all instances is saved at start-up to enable the reset action. Now it is possible to define at which point the instances are saved with the retain action, and also to reset one or more instances rather than all of them.

>XForms tries to be representation-neutral, and so avoids using naming that suggests a particular representation

>The rendering has to be done in the browser. The data source is markup in an otherwise static HTML page.

    1. Relationships
var cartoon = {"george jetson":{"son":"elroy","daughter":"judy"} }
Use the Object constructor to convert a string to an object:

cartoon["george jetson"].son = Object(cartoon["george jetson"].son)
Then bind the sibling value:

cartoon["george jetson"].son.sister = cartoon["george jetson"].daughter
And use toString to get the original value:

cartoon["george jetson"].son.toString()
    1. JSONSchema Forms
    1. XSLTForms
    <?xml-stylesheet href="../../../xsltforms/xsltforms.xsl" type="text/xsl"?>
    <html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ev="http://www.w3.org/2001/xml-events">
    <head>
       <title>Game</title>
       <style type="text/css">
        body {margin-left: 2em; font-size: 200%}
        .row {display: block}
        .cell {display: inline-block; height: 2em; width: 2em;
             border: thin black solid; text-align: center;
             margin: 0; line-height: 2em}
        .xforms-repeat-item {display: inline}
        .xforms-label {padding: 0; color: black}
       </style>
       <model xmlns="http://www.w3.org/2002/xforms">
          <instance>
	     <data xmlns="">
	        <row><cell>1</cell><cell>5</cell><cell>8</cell><cell>12</cell></row>
	        <row><cell>2</cell><cell>6</cell><cell>9</cell><cell>13</cell></row>
	        <row><cell>3</cell><cell>7</cell><cell>10</cell><cell>14</cell></row>
	        <row><cell>4</cell><cell>.</cell><cell>11</cell><cell>15</cell></row>
	     </data>
          </instance>
       </model>
    </head>
    <body>
       <group xmlns="http://www.w3.org/2002/xforms">
          <repeat ref="row"> 
	     <group class="row">
	        <repeat ref="cell">
	           <trigger class="cell" appearance="minimal">
		      <label><output ref="."/></label>
		      <action ev:event="DOMActivate">
		         <setvalue ref="//cell[.='.']" value="context()"/>
		         <setvalue ref="." value="'.'"/>
		      </action>
	           </trigger>
	        </repeat>
	     </group>
          </repeat>
       </group>
    </body>
    </html>
    1. References
  • https://www.balisage.net/Proceedings/vol21/html/Pemberton02/BalisageVol21-Pemberton02.html
  • https://homepages.cwi.nl/~steven/Talks/2017/06-10-iot/game-demo.html
  • https://www.balisage.net/Proceedings/vol26/html/Walsh01/BalisageVol26-Walsh01.html
⚠️ **GitHub.com Fallback** ⚠️