choose code

Can people take a look at my implementation of cs:choose in python and
tell me if I have this right?

http://github.com/bdarcus/citeproc-py/blob/ee80b653bf6c36207322a0956a39b92b3afcdc44/citeproc.py

I’m confident that the condition and process_children functions are
basically correct (if not totally finished), but am wondering: is the
simplicity of process_choose (lines 122-138) too good to be true?

Bruce

Can people take a look at my implementation of cs:choose in python and
tell me if I have this right?

http://github.com/bdarcus/citeproc-py/blob/ee80b653bf6c36207322a0956a39b92b3afcdc44/citeproc.py

I’m confident that the condition and process_children functions are
basically correct (if not totally finished), but am wondering: is the
simplicity of process_choose (lines 122-138) too good to be true?

The logic looks right from here. When I said that I made one bad
decision in citeproc-js, and that it was flattening the XML into a
list of start and stop tags, conditions was one of the things I had in
mind. In a node tree it should be very simple. Nice to see it in
code.

Frank