Hallo!
I'm just implementing the XML support for PDContainer and now I'm a
little bit unsure, how the format should look like...
My problem is, that there are associativ containers (like map, set,
multimap, multiset) which have key-value pairs, and sequences (like
vector, list, stack, ...) which have only one element.
So some examples (I wrote comments after #):
(a = sequences, b = associativ containers)
1a)
<PDContainer type="h_list"> #container type as attribute
<list> # would be a pd list
<float> 34 </float> # with a float
<symbol> afsdf </symbol> # and a symbol
</list>
<float> 423 </float>
<symbol> sfad </symbol>
<list>
<float> -4 </float>
<symbol> herc </symbol>
</list>
</PDContainer>
1b) (with abbreviations for list, float and symbol)
<PDContainer type="h_map">
<key> #1.key
<l> #know list is unnecessary
<f> 34 </f>
<s> afsdf </s>
</l>
</key>
<value> #1.value
<f> 423 </f>
</value>
<key> #2.key
<s> sfad </s>
</key>
<value> #2.value
<l>
<f> -4 </f>
<s> herc </s>
</l>
</value>
</PDContainer>
What I don't like here is, that the keys and values are mixed together,
so there should be I think an other element tag or something like that ...
2a) with element tag, without list:
<PDContainer type="h_list">
<element> # element with 2 entries, so this is a list
<f> 34 </f>
<s> afsdf </s>
</element>
<element>
<f> 423 </f>
</element>
</PDContainer>
2b)
<PDContainer type="h_map">
<element>
<key>
<f> 34 </f>
<s> afsdf </s>
</key>
<value>
<f> 423 </f>
</value>
</element>
</PDContainer>
So I think 2 is clearer than 1, but isn't it too complicated ?
(is there a better word for element ? - because its much to write ...)
Please share your thoughts...
Thanks,
LG
Georg