Is there way to format html code present in java string to corresponding output which browser shows without browser in java itself? Ex: lets say string is,
<ul>
<li>red</span></li>
<li>green</span></li>
<li>orange<br /></span></li>
</ul>
<br />number list:<br />
<ol>
<li>one</li>
<li>two</li>
<li>three
<ul>
<li>embedded bullet
<ul>
<li>again
<ul>
<li>again
<ul>
<li>next one</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>four</li>
</ol>
This is O/P:
outputString="
• one
• two
• three
number list:
1. one
2. two
3. three
• embedded bullet
• again
• next one
4. four"
then formatter should convert this into outpuString string.