epub: use a state-based parser model to generate document events.