<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Windows Perl Scripting Forums &#187; Tag: pls consider my problem - Recent Posts</title>
<link>http://www.roth.net/forums/</link>
<description>Windows Perl Scripting Forums &#187; Tag: pls consider my problem - Recent Posts</description>
<language>en</language>
<pubDate>Fri, 24 May 2013 20:27:46 +0000</pubDate>

<item>
<title>mahalatchumi on "XML tag closing in hierarchical manner"</title>
<link>http://www.roth.net/forums/topic.php?id=425#post-783</link>
<pubDate>Mon, 09 Jan 2012 23:11:49 +0000</pubDate>
<dc:creator>mahalatchumi</dc:creator>
<guid isPermaLink="false">783@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi,I've problem in multilevel tag closing,i want to close the tags form the inner level then come to close its outer level&#60;/p&#62;
&#60;p&#62;&#38;lt;p_list-bull(1)&#38;gt;Use Microsoft Windows accessibility options to:&#60;br /&#62;
&#38;lt;p_list-simple(2)&#38;gt;– Magnify the display&#60;br /&#62;
&#38;lt;p_list-simple(2)&#38;gt;– Change the size of text and icons&#60;br /&#62;
&#38;lt;p_list-simple(2)&#38;gt;– Convert the text displayed into speech (i.e. narrator)&#60;br /&#62;
&#38;lt;p_list-simple(2)&#38;gt;– Change the contrast&#60;br /&#62;
&#38;lt;p_list-simple(2)&#38;gt;– Display an onscreen keyboard&#60;br /&#62;
&#38;lt;p_list-simple(2)&#38;gt;– Convert the mouse for left-handed use.&#60;br /&#62;
&#38;lt;p_list-bull(1)&#38;gt;Deliver learning through an audio podcast rather than written handouts for visually impaired learners.&#60;br /&#62;
&#38;lt;p_list-bull(1)&#38;gt;Increase the character size on handouts for visually impaired learners.&#60;br /&#62;
&#38;lt;p_list-bull(1)&#38;gt;Adjust background colours and fonts to assist dyslexic learners.&#60;br /&#62;
my output should be like the below code&#60;br /&#62;
&#38;lt;list list-type=&#34;bullet&#34;&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;Use Microsoft Windows accessibility options to:&#60;br /&#62;
&#38;lt;list list-type=&#34;simple&#34;&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;#x2013; Magnify the display&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;#x2013; Change the size of text and icons&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;#x2013; Convert the text displayed into speech (i.e. narrator)&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;#x2013; Change the contrast&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;#x2013; Display an onscreen keyboard&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;#x2013; Convert the mouse for left-handed use.&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;/list&#38;gt;&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;Deliver learning through an audio podcast rather than written handouts for visually impaired learners.&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;Increase the character size on handouts for visually impaired learners.&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;Adjust background colours and fonts to assist dyslexic learners.&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#38;lt;xref ref-type=&#34;page&#34; id=&#34;page_13&#34;/&#38;gt;Provide feedback on written work using the comments facility and track changes rather than handwritten notes, so that the learners can change character size or use a text to speech application to hear feedback.&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;&#60;br /&#62;
&#38;lt;/list&#38;gt;&#60;br /&#62;
i tried the below code but i gives single item list only i d't know where its wrong pls correct my mistake &#60;/p&#62;
&#60;p&#62;use strict;&#60;br /&#62;
my $inputfile = $ARGV[0];&#60;/p&#62;
&#60;p&#62;open (IN,&#34;$inputfile&#34;) &#124;&#124; die (&#34;Can't open the input file for reading&#34;);&#60;br /&#62;
undef $/;&#60;br /&#62;
my $str = &#38;lt;IN&#38;gt;;&#60;br /&#62;
 while($str =~ /&#38;lt;list-(bull)&#38;gt;(?:(?:(?!&#38;lt;\/list-bull&#38;gt;).)*)&#38;lt;\/list-\1&#38;gt;/sgi)&#60;br /&#62;
    {&#60;br /&#62;
    $str =~ s#&#38;lt;list-(bull)&#38;gt;(?:(?:(?!&#38;lt;\/list-bull&#38;gt;).)*)&#38;lt;\/list-\1&#38;gt;#&#38;amp;List_find($&#38;amp;)#sgie;&#60;/p&#62;
&#60;p&#62;    }&#60;/p&#62;
&#60;p&#62;sub List_find&#60;br /&#62;
{&#60;br /&#62;
my $line = @_[0];&#60;br /&#62;
my $currentlevel = 0;&#60;br /&#62;
while($line =~ /^[\s\S]*?&#38;lt;(P_list-(\w+)\((\d+)\))&#38;gt;(.*?)&#38;lt;\/\1&#38;gt;\s*/si)&#60;br /&#62;
{&#60;/p&#62;
&#60;p&#62;    my ($tag, $kind, $level, $text) = ($1, $2, $3, $4);&#60;br /&#62;
    if ($currentlevel &#38;lt; $level) {&#60;br /&#62;
    while($currentlevel &#38;lt; $level) {&#60;br /&#62;
            $line = &#34;\n&#38;lt;list list-type=\&#34;$kind\&#34;&#38;gt;\n&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#34;;&#60;/p&#62;
&#60;p&#62;            $currentlevel++;&#60;/p&#62;
&#60;p&#62;        }&#60;/p&#62;
&#60;p&#62;} elsif ($currentlevel &#38;gt; $level) {&#60;/p&#62;
&#60;p&#62;        while($currentlevel &#38;gt; $level) {&#60;br /&#62;
            $currentlevel--;&#60;br /&#62;
            $line =&#34;&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;\n&#38;lt;/list&#38;gt;\n&#34;;&#60;br /&#62;
        }&#60;br /&#62;
        $line = &#34;&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;\n&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#34;;&#60;/p&#62;
&#60;p&#62;    } else {&#60;/p&#62;
&#60;p&#62;       $line = &#34;&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;\n&#38;lt;list-item&#38;gt;&#38;lt;p&#38;gt;&#34;;&#60;/p&#62;
&#60;p&#62;    }&#60;br /&#62;
        $line .= $text;&#60;/p&#62;
&#60;p&#62;   # print $line;&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;while($currentlevel &#38;gt; 0) {&#60;br /&#62;
    $currentlevel--;&#60;br /&#62;
    $line .= &#34;&#38;lt;/p&#38;gt;&#38;lt;/list-item&#38;gt;\n&#38;lt;/list&#38;gt;\n&#34;;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;#print $line;&#60;br /&#62;
return &#34;$line&#34;;&#60;br /&#62;
}&#60;br /&#62;
open (OUT,&#34;&#38;gt;$inputfile\.xml&#34;) &#124;&#124; die (&#34;Can't open the output file for writing&#34;);&#60;br /&#62;
print OUT $str;&#60;br /&#62;
close (OUT);
&#60;/p&#62;</description>
</item>

</channel>
</rss>
