gugan has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks
I want close the tags in hierarchical way
E.g
This is my input
<P_Normal><list-bull></P_Normal> <P_list-bull(1)>Use Microsoft Windows accessibility </P_list-bull(1)> <P_list-simple(2)> Magnify the display </P_list-simple(2)> <P_list-simple(2)> Change the size of text and icons </P_list-simple +(2)> <P_list-simple(2)> Convert the text displayed </P_list-simple(2)> <P_list-simple(2)> Change the contrast </P_list-simple(2)> <P_list-simple(2)> Display an onscreen keyboard </P_list-simple(2)> <P_list-simple(2)> Convert the mouse for left-handed use. </P_list-s +imple(2)> <P_list-bull(1)>Deliver learning through </P_list-bull(1)> <P_list-bull(1)>Increase the character . </P_list-bull(1)> <P_list-bull(1)> fonts to assist dyslexic learners. </P_list-bull(1)> <P_list-bull(1)>Adjust background colours </P_list-bull(1)> <P_Normal></list-bull></P_Normal>
I want to close the list tags in hierarchical manner
<list list-type="bullet"> <list-item><p>Use Microsoft Windows accessibility options to: <list list-type="simple"> <list-item><p> Magnify the display</p></list-item> <list-item><p> Change the size of text and icons</p></list-item> <list-item><p> Convert the text displayed into speech (i.e. narrator)< +/p></list-item> <list-item><p> Change the contrast</p></list-item> <list-item><p> Display an onscreen keyboard</p></list-item> <list-item><p> Convert the mouse for left-handed use.</p></list-item> </list></p></list-item> <list-item><p>Deliver learning through </p></list-item> <list-item><p>Increase the character </p></list-item> <list-item><p> fonts to assist dyslexic learners.</p></list-item> <list-item><p> Adjust background colours</p></list-item> </list></p>
This is my first perl task
Help me and thank in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hierarchical tag closing
by roboticus (Chancellor) on Jan 06, 2012 at 11:42 UTC |