|
From: Henrik /K. <kaa...@us...> - 2009-10-20 21:44:26
|
Daniel Gollub wrote: > 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 > > At the face of it, this seems to make sense. However, I need to work on "my" mozilla-sync capabilities a bit more, before I can answer whether "this kind of capabilities definition would represent all the combinations?" |