Re: Patch to custom object: object-specific properties (preliminary)
From: Alan Horkan <horkana maths tcd ie>
To: dia-list gnome org
Subject: Re: Patch to custom object: object-specific properties (preliminary)
Date: Sun, 23 Nov 2003 22:10:32 +0000 (GMT)
On Fri, 14 Nov 2003, Marco Contenti wrote:
> Date: Fri, 14 Nov 2003 20:22:01 +0100
> From: Marco Contenti <m.contenti@libero.it>
> Reply-To: dia-list@gnome.org
> To: dia-list@gnome.org
> Subject: Patch to custom object: object-specific properties (preliminary)
>
> Hello,
> here is a very first version of what I described last week. Now only four
> types are supported. It seems it's working. Please try using it and tell me
> what you think about.
> <shape ... >
> ...
> <ext_attributes>
> <attribute name="ID" type="string"/>
> <attribute name="Resistance (ohms)" type="int"/>
> <attribute name="Power dissipation (W)" type="real"/>
> <attribute name="SMD package" type="bool"/>
> </ext_attributes>
> ...
> </shape>
Although it is highly unlikely that this XML will be parsed by anything
other than Dia it is best practice to preceed the closing slash with a
space, it makes things easier for crappy parsers. (It's trivial and I'm
nit picking, but that's just what I do)
like so:
<ext_attributes>
<attribute name="ID" type="string" />
<attribute name="Resistance (ohms)" type="int" />
<attribute name="Power dissipation (W)" type="real" />
<attribute name="SMD package" type="bool" />
</ext_attributes>
Maybe you will want to process thse tags with an external script or
something and the extra spaces might make things easier.
(I still have reservations about this but I'm dont want to hold you back,
just suggest that a more generalised approach might pay off in the
long run).
Sincerely
Alan Horkan
http://advogato.org/person/AlanHorkan/