A More Complex Generator

One can derive more than one generator:

  • When no elements are open, it will generate all XML tokens.

  • When one or more elements are opened, it will generate the remaining "children" of the current element, suppressing the end tag token.

New Models for Processing Text and XML with Python Sam Wilmott
Slide 35 of 51        www.wilmott.ca