Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Monks, i have a list as shown below (sample) which is not a xml file. The file may have many nesting.
<input> <ordered-list> <item>some text <item>some text <item>some text <bulleted-list> <item>some text <item>some text <item>some text <end-list> <item>some text <item>some text <item>some text <end-list> </input>
I want to convert the above list into, as shown below.
<input> <ordered-list> <ordered-item>some text <ordered-item>some text <ordered-item>some text <bulleted-list> <bulleted-item>some text <bulleted-item>some text <bulleted-item>some text <end-list> <ordered-item>some text <ordered-item>some text <ordered-item>some text <end-list> </input>
I tried with repeated push and pop using if statement, is there any module to do this or is there any short way to achieve this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nested list items
by Fletch (Bishop) on Sep 21, 2006 at 15:11 UTC | |
by ikegami (Patriarch) on Sep 21, 2006 at 16:02 UTC | |
by jdtoronto (Prior) on Sep 21, 2006 at 16:24 UTC | |
|
Re: Nested list items
by davorg (Chancellor) on Sep 21, 2006 at 15:13 UTC | |
|
Re: Nested list items
by ysth (Canon) on Sep 21, 2006 at 15:45 UTC | |
|
Re: Nested list items (s///ge)
by tye (Sage) on Sep 21, 2006 at 16:36 UTC | |
|
Re: Nested list items
by grep (Monsignor) on Sep 21, 2006 at 15:12 UTC |