Your skill will accomplish what the force of many cannot |
|
PerlMonks |
XML::Twig - provide additional parameters to twig_roots handlersby kejv2 (Acolyte) |
on Sep 30, 2012 at 19:59 UTC ( [id://996531]=perlquestion: print w/replies, xml ) | Need Help?? |
kejv2 has asked for the wisdom of the Perl Monks concerning the following question: Hello all, I am parsing a xml file using XML::Twig like this:
I have a run-time parameter which I want to get in div (or any other) element handler. How can I do this? I would expect something like putting this parameter into XML::Twig constructor and then getting it from twig $t element. But there is nothing like this described in the documentation. The only way I can think about is to define own element handling package with method returning my parameter and putting this package as elt_class option into XML::Twig constructor. But that seems terribly artificial to me. Any better ideas?
Back to
Seekers of Perl Wisdom
|
|