Re: XForms Basic

On Tue, 9 Dec 2003, Daniel Brooks wrote:
>
> Well, you do have a point there. Just how expensive is a global
> attribute? It seems like you're trading a trivial amount of memory for a
> trivial amount of cpu time.

It's expensive in terms of intrusiveness. In the middle of a MathML
document you don't suddenly want half a dozen attributes from another
namespace -- if you can keep as much as possible in one attribute, it is
generally, IMHO, neater.

In any case, the repeat attribute is pretty simple now. It's only a
keyword -- "template" or "repeated" -- optionally followed by an integer.
What's the problem?


> You still have to acknowledge the cost to tools programmers who have to
> account for a non-standard attribute type, and authors who have to learn
> it, etc. It seems like it'd just be easier to go with two attributes.

Then they just need to account for two attributes, and authors have to
learn it, etc. I don't see much advantage between:

   <foo html:repeat="template" html:repeatIndex="2" id="test">

...vs:

   <foo html:repeat="template 2" id="test">

It also means you have to define how to handle another attribute when it's
where it shouldn't be, etc.

I dunno. Maybe you're right.


> Also, I seem to have forgotten to mention that the second parameter for
> the repitition template (called index, but really just a count of the
> copies of the template) isn't really needed in the source

That number is just the initial index to use. It's not ever really useful
to be honest. I don't see why anyone would really use it. Maybe I should
just get rid of it.


> it could be exposed simply as a dom attribute.

It is. repetitionIndex.


> That, and you never specify that it's supposed to be decremented when
> you remove a copy of the template.

It's not.


> That's either a simple omission, or it's just used as a way to make sure
> the next repitition block gets a unique index.

That's what it's used for.


> The former is easily fixed, but I'm not sure the latter will work.

The algorithm walks all the repetition blocks until the index is greater
than all of them, and uses that for the new block. So why wouldn't it
work?


> Either way it's hard to tell because the purpose of the number isn't
> explicitly stated.

I've added a note to myself that I must explain it better.


> Sure, just make <form> something that knows which of it's children are
> selected, and draws them appropriately.

I'm confused as to why the form needs to have anything to do with this.
There is not a 1:1 mapping of forms to repetition blocks. The two are
designed to be independent.


> Something like this:
>
> ...
> <table>
>   <form id="foo">
>     <tr repeat="template" id="row">...</tr>
>   </form>
> </table>
> <input type="add" template="row" form="foo">
> <input type="move_up" template="row" form="foo">
> <input type="move_down" template="row" form="foo">
> ...

I don't see why you need the form in that example (not to mention <form>
can't be a child of <table>):

   ...
   <table>
    <tr repeat="template" id="row">...</tr>
   </table>
   <input type="add" template="row">
   <input type="move_up" template="row">
   <input type="move_down" template="row">
   ...

Either way, that doesn't solve the problem -- how do you know which row is
selected? How do you select a row? What if the "row" is actually a button?

   <button repeat="template"/>


> Obviously the <form> tag would be a bit different than we use today, and
> you wouldn't be able to put it in the <head>, it'd have to go places
> it's never been allowed but where people have always put it anyway, etc.

Oh, you wanted to make the form be a <select> widget or some such.

That seems like excessive overloading. :-)

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 9 December 2003 10:53:42 UTC