Model with attribute for

From W3C XForms Group Wiki (Public)
Jump to: navigation, search

In this case, the xf:model element itself would be treated as a control for purposes of meta-control bindings. Because models content is implicitly not rendered, any internal meta-controls would similarly fail to render. However, a meta-control with an associated @for statement could reference the model itself, without having to reference any given control. For instance,

<html xml:lang="en-us">
  <head>
    <xf:model id="data-model">
      ...
    </xf:model>
  </head>
  <body>
    <xf:label for="data-model" lang="en-us"><h1>Center Point</h1></xf:label>
    <xf:label for="data-model" lang="en-uk"><h1>Centre Point</h1></xf:label>
    <xf:label for="data-model" lang="fr"><h1>Point Central</h1></xf:label>
    <xf:help for="data-model" lang="en-us en-uk"><div>This is help content in English.</div></xf:help>
    <xf:help for="data-model" lang="fr"><div>Il s'agit d'aider les contenus en français, traduit (probablement mal) dans GoogleTranslate.</div></xf:help>
    ..
  </body>
</html

Listing 8. Using lang for internationalization of content.


<body>
    <h1>Center Point</h1>
    <div class="help">This is help content in English.</div>
</body>

Listing 9. rendered output.

Among other things, this would make it possible to utilize the common F1=help paradigm even when there is no active control on the page.