Subject: | changing handlers during parsing |
I tried to write to split Handlers for a scheme into different files, one for each major element type. Whenever I tried to use set_handler or set_content_handler, the parser just continued using the initial handler. I used XML::SAX::Expat, which delegates this kind of business to XML::SAX::Base, right? So, after hours of investigation, I think the problem is a local parameter in XML::SAX::Base called $self->{ParseOptions}. This never changes after creation and can't be modified through methods, at least I couldn't figure out how. Adding the line
$self->{ParseOptions}->{$handler_type} = $new_handler;
to set_handler resolved the issue. You might think of incorporating this, or is it my ignorance and I don't see the obvious solution?
Cheers, Benjamin