[CREATE] OpenRaster and filters

Liam R E Quin liam at holoweb.net
Thu Jun 12 15:32:51 PDT 2008


On Wed, 2008-06-11 at 21:20 +0200, Cyrille Berger wrote:
[...]
> 1) <filter name="standard:blur" type="standard:gaussianblur">
>    <params>
>      <param name="radius">10</param>
>    </params>
>  </filter>
> 
> 2) <filter:standard:blur radius="10" />
> 
> 3) <filter:standard:blur>
>   <radius>10</radius>
>  </filter:standard:blur>
> 
> The main weakness of 1) is that this doesn't allow DTD/RelaxNG checking and 
> validation, but it makes easier to extend since you don't have to write the 
> schema for your filter

Yes, although with W3C XML Schema 1.1 you'd be able to do some checking
here, it would not be in a very modular way, I think.

> 
> While 2) and 3) have the advantage to allow DTD/RelaxNG validation, while 
> still allowing extensability. 2) is similar to the SVG syntax.
> 
> 3) and 1) have the advantage that you can easily pass more complex parameters 
> to the filter, for instance, the mask on a layer could be serialize as:
> 
> <filter:standard:mask>
>   <mask> <layer src="alphamask.png" /> </mask>
> </filter:standard:mask>

A compromise between (2) and (3) is to allow both
attributes and elements,
<blur radius="10" />
being the same as
<blur><radius>10</radius></blur>

This is more complex to implement, and if the complexity isn't
worth while, I'd go for elements, i.e. (1) or (3).

You then have to ask what sort of validation you want; both
can have validation applied at some level.  Supplying a schema
of some sort that says that a particular set of parameters are
needed might be useful, although in general it can get
arbitrarily complex...
blur hradius="10" vradius="6" would disallow a radius value...
schematron (and XSD 1.1) can express this to some extent, maybe
sufficiently.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org



More information about the CREATE mailing list