[Cosmo-dev] Sharing format questions
Morgen Sagen
morgen at osafoundation.org
Mon Aug 14 14:24:48 PDT 2006
On Aug 14, 2006, at 11:48 AM, Brian Moseley wrote:
> since we're taking the proposal back onto the list, here are my
> latest comments:
>
> On 8/11/06, Morgen Sagen <morgen at osafoundation.org> wrote:
>
>> I've put in an example of expressing lists (unordered and ordered)
>> and
>> dictionaries. One thing I'm not sure about is this:
>>
>> <kinds>
>> <value><con:Note/></value>
>> <value><cal:Event/></value>
>> </kinds>
>>
>> I put <value> in there to be consistent with other lists. What do
>> you
>> think?
>
> this is similar to spring's xml configuration language. i like their
> approach a little better though. how's about taking a cue from them
> and allowing these options:
>
> 1) simple scalar value => <value>abcdef</value>
> 2) item reference => <item ref="mySecurityManager"/>
Right, I updated my example to something like this:
<item ref="24215c52-2a64-11db-a2b3-0003472d8b45" />
> 3) kind => <kind:Note/>
Each kind needs to be namespace-qualified, so I was suggesting this
syntax, especially since we have multiple kinds per item:
<kinds>
<value><con:Note/></value>
<value><cal:Event/></value>
</kinds>
Originally I left out the <value> elements, but then I put them in to
be consistent with the list syntax I'm using for other attributes.
> 4) list (ordered) =>
> <list>
> <value>abcdef</value>
> <value>deadbeef</value>
> </list>
> 5) map =>
> <map>
> <entry key="bcm" ref="1"/>
> <entry key="morgen" ref="2"/>
> </map>
Do you mean literally there should be elements named "list" and
"map"? Or does the attribute name go there instead, like this (where
'foo' and 'bar' are attribute names):
<con:foo> <!-- list -->
<value>abc</value>
<value>def</value>
</con:foo>
<con:bar> <!-- dictionary -->
<value key="red">abc</value>
<value key="white">def</value>
<value key="blue">ghi</value>
</con:bar>
> notice i used <itemref> to <item ref=""> - i like that better, cos it
> keeps the door open to using the same element for inline items should
> we want to do that.
Agreed, and I updated the example.
> i also suggest using a separate namespace for
> kinds so that it's a little more obvious what <kind:Note> is.
Yep, doing that already.
>
>> Also, as for a deliverable, do you think we need an XSD? I tried
>> my hand at
>> one, but got a bit lost. For example, I don't know how to express
>> a custom
>> data type (uuid), nor how to say that a <value> can either be an
>> <itemref>
>> or a literal value:
>
> never written one myself either. for reference, here's the spring xsd
> that defines list, set, item and value, among other things:
>
> <http://www.springframework.org/schema/beans/spring-beans.xsd>
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev
More information about the cosmo-dev
mailing list