Cyrille Berger a écrit :
On Thursday 21 January 2010, Olivier BERTEN wrote:
There's a mix of different reasons, the least not being my lack of
knowledge of XML and programming skills...
I first went from <RGB r="1" g="1" b="1"> to <RGB values="1 1 1"> simply
because it was easier to deal with different color models the same way
(you were talking about laziness ;-) )
Well, I don't know if I am spoiled by the framework I use for xml, but for me
accessing an attribute of an element is as simple as "red =
element.attribute("r",0.0).toDouble()" :) The two reasons we went for that
form is that in "1 1 1" the order of channels is not specified, and it is also
not possible to validate it with a schema (there have been changed on XML
schemas to also validate data, but I don't know if it would work in that
case).
I understand the validation point but I'm not really sure of the
interest in validating data... since <sRGB r="20" g="-100" b="0.2"/>
would validate but it wouldn't make any sense... but it might be my bad
knowledge of xml ;-)
For the code question, mine is
"item.values[(elem.attrib['model'],elem.attrib['space'])] =
map(eval,elem.text.split())". So it's the same code for any model, which
makes sense since I don't display the colors at parsing time but later
in the process, where I use data provided in another "format" anyway.
For the rest (metadata, swatch organization) wich aren't in the create
draft, I made some choices but I'm already reconsidering most of them...
What are the choice ? I think we would aim to use things like RDF/XMP, but
neither of them are "simples", so I don't know if we should not also have a
simple metadata spec that we can reuse (something based on dublin core,
maybe).
My main choice was to not use (yet) any existing spec because it would
complexify my xml and at this early developement stage I want to keep it
easy to read for humans. But this is most probably going to change.
Olivier
_______________________________________________
CREATE mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/create