[Cosmo-dev] Sharing format questions

Morgen Sagen morgen at osafoundation.org
Mon Aug 14 15:04:38 PDT 2006


On Aug 14, 2006, at 2:54 PM, Brian Moseley wrote:

> On 8/14/06, Morgen Sagen <morgen at osafoundation.org> wrote:
>
>> 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.
>
> okay, i agree on the namespace issue. let's drop the wrapping <value>
> though and reserve that element for simple values.

Like this?

      <kinds>
              <con:Note/>
              <cal:Event/>
      </kinds>


>
>> 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):
>
> i like having the collection type explicit in the structure of the
> xml. it makes the xml easier to read, and we can write tools that can
> process the data structures regardless of what the actual content item
> might be. otherwise, the tools will have to understand that <con:foo>
> is a list.

Like this?

         <con:foo>
             <list>
                 <value>abc</value>
                 <value>def</value>
             </list>
         </con:foo>

         <con:bar>
             <map> <!-- or dict -->
                 <value key="red">abc</value>
                 <value key="white">def</value>
                 <value key="blue">ghi</value>
             </map>
         </con:bar>

...or like this?

         <con:foo cardinality="list">
             <value>abc</value>
             <value>def</value>
         </con:foo>

         <con:bar cardinality="map">
             <value key="red">abc</value>
             <value key="white">def</value>
             <value key="blue">ghi</value>
         </con:bar>

...or other options?






More information about the cosmo-dev mailing list