Open
Description
After attempting to implement content model validation (#166), I am convinced it is best implemented as a postprocessing step on the tree already built (because of all the context-sensitive content model rules).
In order to be able to report violations usefully, this needs source line:offset information in the tree, for at least one treebuilder.
The changes needed to propagate relevant data from the stream would most probably involve at least tokenizer, token structure, and treebuilders.
Some treebuilders wouldn’t know by default what to do about the source offset (lxml’s Element is sealed to property extension and going custom element may be a performance issue) but that’s okay as long as the information is available.