W3C home > Mailing lists > Public > public-multilingualweb-lt@w3.org > April 2012

RE: Practical question: elements or attributes?

From: Yves Savourel <ysavourel@enlaso.com>
Date: Tue, 17 Apr 2012 05:07:50 -0600
To: "'Arle Lommel'" <arle.lommel@gmail.com>, "'Multilingual Web LT Public List'" <public-multilingualweb-lt@w3.org>
Message-ID: <assp.045416e00d.assp.0454871a28.003401cd1c8a$5485eca0$fd91c5e0$@com>
Hi Arle, all,

For HTML, like Felix noted one can always find a way to set things in attributes.
It's far less intrusive for the host format than elements.

For other XML-based formats using elements in a distinct namespace may be possible. But it may also be simpler to use the same mechanism as the one used in HTML.

And there is possibly the non-markup-based formats (e.g. scripts) where, if needed, we could fall back on some special types of comments.

The only thing we need to be aware of at this point is probably the value/content of those metadata: most seem to be simple values, but maybe a few could be 'content' with some line-breaks/white-spaces requirements? In that cases storing them in attributes may be more challenging. But I don't recall seeing any complex content so far.


-----Original Message-----
From: Arle Lommel [mailto:arle.lommel@gmail.com] 
Sent: Tuesday, April 17, 2012 2:46 AM
To: Multilingual Web LT Public List
Subject: Practical question: elements or attributes?

Hi all,

I realize that we are still trying to nail down the required data categories and that implementation is still a bit down the road, but I wanted to ask a general question: Do we prefer that our data categories be declared as attributes or as elements? Some, like translate, are quite easy to have as attributes and really only make sense that way, but what about something complex like processTrigger? That would be very difficult to declare as an attribute (it would need to be a bundle of attributes) and it makes sense to me to declare it as an element.

However, using elements would also be more disruptive to the target formats than would using attributes. For instance, in an HTML5+ITS combination the core structure of HTML5 could remain unaltered if we use attributes, but when we start adding elements, we are making more fundamental structural changes.

This question came up because I thought it would be a useful exercise to create examples in HTML5 snippets of what these data categories would actually look like, but I found I did not always know the best way to approach them. (It is a useful exercise, however, because it can help identify issues that need to be resolved. For example, in creating an example for autoLanguageProcessingRule I realized that its primary usage is probably not as a rule but as a pragma-type construct, which suggests we need to change the name somehow.

Any thoughts on general principles or how to decide? Yves, this sounds like something you would have an opinion on.

Received on Tuesday, 17 April 2012 11:08:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:31:43 UTC