|
From: Daniel G. <go...@b1...> - 2009-10-20 20:35:28
|
On Tuesday 20 October 2009 07:02:17 pm Henrik /KaarPoSoft wrote:
> Some elements in an xml format can have attributes, such as:
> <Address Location="Home">
> Is there any way to define which such capabilities a plugin supports?
>
> One plugin may support only one address without specifying location,
> another plugin may support only Home,
> and a third may support Home and Work,
> etc.
>
In theory: yes.
Unfortuantely the xmlformat-merger and -demerger function is not yet handling
attributes. It's just handles the fields.
But you can already define capabilities that you only support a limit type of
attributes - e.g. as value enumeration (valenum).
This is pretty new due to the new "capsformat" stuff.
The capabilities defenition for your example would look then something like
that:
Caps example which supports only Home and Work:
-----8<------
<?xml version="1.0"?>
<Caps Version="1.0" CapsFormat="xmlformat">
<ObjType Name="contact">
<Cap>
<Name>Address</Name>
<Parameter>
<Name>Location</Name>
<ValEnum>Home</ValEnum>
<ValEnum>Work</ValEnum>
</Parameter>
</Cap>
[...]
</ObjType>
</Cap>
------>8-----
supports only Home:
-----8<------
<?xml version="1.0"?>
<Caps Version="1.0" CapsFormat="xmlformat">
<ObjType Name="contact">
<Cap>
<Name>Address</Name>
<Parameter>
<Name>Location</Name>
<ValEnum>Home</ValEnum>
</Parameter>
</Cap>
[...]
</ObjType>
</Cap>
------>8-----
supports no specific location
-----8<------
<?xml version="1.0"?>
<Caps Version="1.0" CapsFormat="xmlformat">
<ObjType Name="contact">
<Cap>
<Name>Address</Name>
</Cap>
[...]
</ObjType>
</Cap>
------>8-----
Supports all values for Location:
-----8<------
<?xml version="1.0"?>
<Caps Version="1.0" CapsFormat="xmlformat">
<ObjType Name="contact">
<Cap>
<Name>Address</Name>
<Parameter>
<Name>Location</Name>
</Parameter>
</Cap>
[...]
</ObjType>
</Cap>
------>8-----
Do you think this kind of capabilities definition would represent all the
combinations?
Still, we would need to implement merger and demerger code to handle the XML
attributes in the xmlformat plugin ...
Best Regards,
Daniel
--
Daniel Gollub Geschaeftsfuehrer: Ralph Dehner
FOSS Developer Unternehmenssitz: Vohburg
B1 Systems GmbH Amtsgericht: Ingolstadt
Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537
EMail: go...@b1... http://www.b1-systems.de
Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D
|