#232 Dictionaries with values the same are not handled properly

v2.0
open
nobody
zsi (169)
5
2008-01-11
2008-01-11
No

I've created a fairly simple structure that largely reflects the examples from the documentation, but I have set up my handler to return a dictionary.

This works most of the time, but if two items in the dictionary have the same value (not key, but value), then the XML generated is incorrect.

Thus:

return {'a':1,'b':2}

returns

<a id="xxxx" xsi:type="xsd:int">1</a>
<b id="yyyy" xsi:type="xsd:int">2</b>

But:

return {'a':1,'b':1}

returns

<a id="xxxx" xsi:type="xsd:int">1</a>
<b href="#yyyy"></b>

Which is not really satisfactory. I can wrap up my dictionaries into classes, and generate a typecode for them, but I'd rather just use a straight dict.

Discussion


Log in to post a comment.