mozumder / HTML6

An HTML6 proposal for single-page apps without Javascript.
85 stars 7 forks source link

How to define model references for element attributes? #4

Open mozumder opened 9 years ago

mozumder commented 9 years ago

When an element references a model, how should its attributes be referenced?

Should the model include attribute definitions? Or should they be referenced explicitly?

This explicitly references the ARTICLE ID attribute in the ARTICLE element:

 <MODEL class="article">
      <PROPERTY class="id" type="string">
 .
 .
 .
 <ARTICLE id="something" model="myArticleData" model_id="myArticleData.id"></ARTICLE>

But this uses the PROPERTY NAME to match the ARTICLE ID:

 <MODEL class="article">
      <PROPERTY class="id" type="string">
 .
 .
 .
 <ARTICLE id="something" model="myArticleData"></ARTICLE>

The first version would be more verbose. The second requires carefully constructed models that matches attribute names.

Any preference?