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


In reply to Hierarchical tag closing by gugan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.