xigt / xigt

eXtensible Interlinear Glossed Text
http://depts.washington.edu/uwcl/xigt
MIT License
31 stars 9 forks source link

Subtle difference in XigtJSON vs XigtXML formats regarding empty item text #56

Open goodmami opened 5 years ago

goodmami commented 5 years ago

In XigtXML, both of the following result in an item whose text value is None:

<item />
<item></item>

However in XigtJSON, the first results in a value of None while the second is an empty string:

{}
{"text": ""}

On serialization, however, both codecs output the first of the two variants, respectively, so a round trip with XigtJSON would lose that empty string value of the item.

Both evaluate as False in a boolean context so this bug might go unnoticed, but it's worth making them consistent to avoid surprises.