The default formatting template

Release 2.0 - ...

The default formatting template is included in the Smartsite.XForms.Rendering.dll as a resource. It's reproduced here, because it offers a good starting point for creating custom formatting templates.

XML CopyCode image Copy Code
<?xml version="1.0" encoding="utf-8"?>
<XFormsHTMLDevice version="1.0" xmlns="http://smartsite.nl/namespaces/xforms/1.0/html">
  <templates>
    <template id="default">
      <format name="form"                       ><![CDATA[<form id="{id}" action="{action}" accept-charset="{charset}" enctype="{enctype}" method="{method}" class="{cls}">
{data}
</form>]]></format>
      <format name="group">
        <format appearance="minimal"><![CDATA[<div class="{cls}" id="{id}"{attr}>{data}</div>]]></format>
        <format appearance="compact"><![CDATA[<div class="{cls}" id="{id}"{attr}>{data}</div>]]></format>
        <format appearance="{data}http://smartsite.nl/namespaces/xforms/1.0:none">{data}</format>
        <format><![CDATA[<fieldset class="{cls}" id="{id}"{attr}><legend class="{labelcls}">{label}</legend>{data}</fieldset>]]></format>
      </format>
      <format name="switch">
        <format appearance="minimal">{data}</format>
        <format appearance="{data}http://smartsite.nl/namespaces/xforms/1.0:none">{data}</format>
        <format><![CDATA[<div class="{cls}" id="{id}"{attr}>{data}</div>]]></format>
      </format>
      <format name="repeat">
        <format appearance="minimal">{data}</format>
        <format appearance="{data}http://smartsite.nl/namespaces/xforms/1.0:none">{data}</format>
        <format appearance="{data}http://smartsite.nl/namespaces/xforms/1.0:repeat-attribute">{data}</format>
        <format><![CDATA[<div class="{cls}" id="{id}"{attr}>{data}</div>]]></format>
      </format>
      <format name="select">
        <format appearance="full"><![CDATA[<div id="{id}" {attr}>{data}</div>]]></format>
        <format><![CDATA[<select size="{size}" id="{id}" name="{name}" multiple="multiple" title="{hint}"{attr}>{data}</select>]]></format>
      </format>
      <format name="selectitem">
        <format appearance="full"><![CDATA[<label{labelattr}><input type="checkbox" value="{value}"{attr} name="{name}" />{label}</label>]]></format>
        <format><![CDATA[<option value="{value}"{attr}>{label}</option>]]></format>
      </format>
      <format name="selectselecteditem">
        <format appearance="full"><![CDATA[<label{labelattr}><input type="checkbox" checked="checked" value="{value}"{attr} name="{name}" />{label}</label>]]></format>
        <format><![CDATA[<option value="{value}" selected="selected"{attr}>{label}</option>]]></format>
      </format>
      <format name="selectitemgroup">
        <format appearance="full"><![CDATA[<fieldset class="xforms-check-group-full"><legend>{label}</legend>{data}</fieldset>]]></format>
        <format><![CDATA[<optgroup label="{label}">{data}</optgroup>]]></format>
      </format>
      <format name="select1">
        <format appearance="full"><![CDATA[<div id="{id}" {attr}>{data}</div>]]></format>
        <format><![CDATA[<select size="{size}" id="{id}" name="{name}" title="{hint}"{attr}>{data}</select>]]></format>
      </format>
      <format name="select1item">
        <format appearance="full"><![CDATA[<label{labelattr}><input type="radio" value="{value}"{attr} name="{name}" />{label}</label>]]></format>
        <format><![CDATA[<option value="{value}"{attr}>{label}</option>]]></format>
      </format>
      <format name="select1selecteditem">
        <format appearance="full"><![CDATA[<label{labelattr}><input type="radio" checked="checked" value="{value}"{attr} name="{name}" />{label}</label>]]></format>
        <format><![CDATA[<option value="{value}" selected="selected"{attr}>{label}</option>]]></format>
      </format>
      <format name="select1itemgroup">
        <format appearance="full"><![CDATA[<fieldset class="xforms-check-group-full"><legend>{label}</legend>{data}</fieldset>]]></format>
        <format><![CDATA[<optgroup label="{label}">{data}</optgroup>]]></format>
      </format>
      <format name="output">
        <format appearance="http://smartsite.nl/namespaces/xforms/1.0:none"><![CDATA[{data}]]></format>
        <format><![CDATA[<span id="{id}" title="{hint}"{attr}>{data}</span>]]></format>
      </format>
      <format name="controlcontainer"           ><![CDATA[<div class="xforms-cc {cls}">{label}{data}{info}{help}</div>
]]></format>
      <format name="controlcontainer"           >
        <format appearance="http://smartsite.nl/namespaces/xforms/1.0:none"><![CDATA[{data}]]></format>
        <format>
          <![CDATA[<div class="xforms-cc {cls}">{label}{data}{info}{help}</div>
]]>
        </format>
      </format>
      <format name="emptycontrolcontainer"      ><![CDATA[{label}{data}{info}]]></format>
      <format name="label"                      ><![CDATA[<label for="{id}"{attr}>{data}</label>]]></format>
      <format name="image"                      >
        <format appearance="http://smartsite.nl/namespaces/xforms/1.0:none"><![CDATA[<img id="{id}" src="{src}" alt="{alt}" title="{hint}"{attr}/>]]></format>
        <format><![CDATA[<img src="{src}" alt="{alt}" title="{hint}"{attr}/>]]></format>
      </format>
      <format name="trigger"                     ><![CDATA[<button name="{name}" id="{id}" type="submit" title="{hint}"{attr} value="1" ><span>{label}</span></button>]]></format>
      <format name="fileinput"                  ><![CDATA[<input name="{name}" id="{id}" type="file" title="{hint}"{attr} />]]></format>
      <format name="textarea"                   ><![CDATA[<textarea rows="{rows}" cols="{cols}" id="{id}" name="{name}" title="{hint}"{attr}>{value}</textarea>]]></format>
      <format name="textinput"                  ><![CDATA[<input maxlength="{maxlength}" name="{name}" id="{id}" type="{type}" value="{value}" title="{hint}"{attr} />]]></format>
      <format name="booleaninput"               ><![CDATA[<input name="{name}" id="{id}" type="checkbox" value="1"  title="{hint}"{attr} />]]></format>
      <format name="validation"                 ><![CDATA[<span class="xforms-field-info xforms-field-alert">{data}</span>]]></format>
      <format name="help"                       ><![CDATA[<span class="xforms-field-info xforms-field-help">{data}</span>]]></format>
      <format name="accesskey"                  ><![CDATA[<u>{data}</u>]]></format>
      <format name="repeatcontainer">
        <format appearance="{data}http://smartsite.nl/namespaces/xforms/1.0:none">{data}</format>
        <format appearance="{data}http://smartsite.nl/namespaces/xforms/1.0:repeat-attribute">{data}</format>
        <format><![CDATA[<div id="{id}" class="{cls}">{data}</div>]]></format>
      </format>
    </template>
  </templates>
</XFormsHTMLDevice>