Comment 1 for bug 1952560

Revision history for this message
scoder (scoder) wrote :

Hmm. The elements are looked up on the "start" event, where they don't have children yet. That happens regardless of whether you ask for the event or not (events=['end'] has the same issue).

The reason is that incremental parsing needs to keep the elements (safely) alive until they are processed by the user, so it creates a Python instance for them (using your element lookup) to assure correct cleanup also in the case of extraction or deletion. That instance then stays alive until the subtree is processed, including the "end" event. It does not get recreated at the "end" event, where the children would be available.

It's definitely a current limitation. But it wouldn't be easy to change, so it's likely to stay that way.

I'll leave the ticket open in case someone wants to give it a try, but don't expect that to happen by itself.