This means that you have to do “unit.target=whatever” after creating a unit. It also means that all code in xliff.py dealing with target nodes have to test if targetnode is not None. And although it is explicitly tested (in test_xliff.test_fuzzy) not to have a target on initial creation, I’m wondering if it is really the desired behavior, and if so, why? My expected behavior would be to create an empty target node.
Example code snippet (current behavior):
>>> unit = xliff.xliffunit('sourcestring') >>> print unit <trans-unit><source>sourcestring</source></trans-unit>
Example code snippet (my expected behavior):
>>> unit = xliff.xliffunit('sourcestring') >>> print unit <trans-unit><source>sourcestring</source><target></target></trans-unit>