in reply to Re: Module for XML output
in thread Module for XML output
The hairiest, albeit perhaps most complete expression of a problem like this one .. appropriate perhaps only for fighting the biggest fires .. is to use a parser and to regard the XML output step as akin to creating an abstract-syntax tree (AST) in a true compiler-like situation. Although the documentation for Parse::RecDescent was (to me, at least) rather baffling to read, it does specifically address this case. I am frankly not suggesting it here, with regard to this post, but in those cases when you are dealing with a truly-nasty input file I can speak from personal experience that this approach does make a dramatically good result. (I once used it to rip into a collection of about 6,000 fairly unpredictable SAS® files, korn-shell scripts, and Tivoli Workload Scheduler® scripts to construct a data-flow model of the entire system. It was quite the beast to do, and there would have been no other way, I think, to have done it.)