A
Abhinav
Hi
I have a script where some chuncks of text are marked between xml-type
tags .
I say 'xml-type' instead of xml as the tags are preceded with a comment
character "# " so that the script does not fail.
I need to be able to extract the data between tags (which can be
nested), and store it in a hash with each key being the tag itself and
the value, the data in between (it is multiline).
The problem is that I initiially tried using Text::Balanced, but gave up
since ir was too demanding for this kind of work .. spanning across
multiple lines ..
I am thinking of stripping the # from all tagged lines so that it
becomes an xml file, adding a root element (which was not present
before) , and then using an xml parser.
My questions :
1. Is the approach feasible, or is there som other simpler way to do it
... (after all, TIMTOWTDI)
2. If the above is the optimal solution, is there any parser/module
shipped along with the standard perl (5.8) distro .. ?
Many thanks ..
Abhinav
I have a script where some chuncks of text are marked between xml-type
tags .
I say 'xml-type' instead of xml as the tags are preceded with a comment
character "# " so that the script does not fail.
I need to be able to extract the data between tags (which can be
nested), and store it in a hash with each key being the tag itself and
the value, the data in between (it is multiline).
The problem is that I initiially tried using Text::Balanced, but gave up
since ir was too demanding for this kind of work .. spanning across
multiple lines ..
I am thinking of stripping the # from all tagged lines so that it
becomes an xml file, adding a root element (which was not present
before) , and then using an xml parser.
My questions :
1. Is the approach feasible, or is there som other simpler way to do it
... (after all, TIMTOWTDI)
2. If the above is the optimal solution, is there any parser/module
shipped along with the standard perl (5.8) distro .. ?
Many thanks ..
Abhinav