[whatwg] WF2 part 1-3

Ian Hickson ian at hixie.ch
Wed Nov 10 14:39:30 PST 2004

On Sun, 29 Aug 2004, Mark Schenk wrote:
> What I would ideally like to see (I'm entering the domain of a 
> full-featured repetition model here) is a way to define one 
> counter/index for a group of repetition templates. Fantasai once 
> suggested using a "repetition-group" template for this.
> Each repetition template belonging to a certain group would use the same 
> index value when one is added/removed etc. The advantage of this would 
> be easier processing of the form fields inside the different repetition 
> blocks, because you can use the same naming scheme, but all names would 
> be unique nonetheless.
> This is probably beyond the scope of this repetition model, but it would 
> be nice imho.

Could you give an example? I don't really understand what you mean.

> > > That would kill the repeat-template attribute because you merge it 
> > > into one attribute on the repetition block
> > 
> > At the cost of much more complicated processing of the attribute, 
> > sadly, and without really simplifying the model at all.
> True, but I don't see any other solution for a repetition model at the 
> moment and I was primarily thinking of ways to kill attributes :)

I don't think killing attributes in and of itself is necessarily a good 
thing. Killing features, yes, but whether two features use one attribute 
or two, the complexity is about the same (and can in fact be higher if you 
have to handle more complicated parsing for the one attribute case).

> > > and it would give you unique values for "repeat" attributes 
> > > throughout the document:
> > > 
> > > repeat="[repetition template id] [repetition block index]"
> > 
> > Why is that an advantage, particularly?
> Well, it would be really nice if a repetition block would have an 
> attribute value unique to that block. As mentioned earlier in the 
> thread, the "repeat" attribute is not unique when multiple templates are 
> used.

Right but why would you want it to be unique? I don't understand. It's not 
like you're ever going to index by it or search for it or anything.

> The nicest solution would be to let each repetition block have a unique 
> id, so you can use the already existing getElementById() method to 
> manipulate the blocks. However, giving the repetition blocks a unique id 
> would further complicate the repeat model, so I didn't mention it 
> before...

Well can't you give them a unique ID using the whole [foo] syntax thing?

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list