more useful options | |
PerlMonks |
XML::Twig outputting root element start tag twiceby benizi (Hermit) |
on Apr 18, 2006 at 17:45 UTC ( [id://544126]=perlquestion: print w/replies, xml ) | Need Help?? |
benizi has asked for the wisdom of the Perl Monks concerning the following question: I'm sure I'm missing some interaction between the various options, but I was wondering if someone (mirod?) could tell me how to accomplish the following. I have an XML document that I want to process with XML::Twig. I want the output document to retain the formatting characteristics of the input document. I also want to use twig_roots, since the file will not fit into memory, and is record-based. (i.e. the processing of each record is self-contained.). I used twig_print_outside_roots, because I want to specify a filehandle for the default prints/flushes. (Is there something more appropriate for that purpose?) The problem is that the root (wrapper) element's start tag is being output twice. Example input:
Desired output:
My attempt:
Actual output:
Back to
Seekers of Perl Wisdom
|
|