Hi!, what I am trying to implement is parsing a ul that can have deeper levels like:
<ul>
<li><a>Title Page</a></li>
<li><a>Copyright Page</a></li>
<li><a>Dedication Page</a></li>
<li>
<a>Preface: About this edition</a>
<ul>
<li><a>#1. Let’s face it: It’s old</a></li>
<li><a>#2. The world has changed</a></li>
<li><a>Don’t get me wrong...</a></li>
</ul>
</li>
<li><a>Index</a></li>
</ul>
Hi!, what I am trying to implement is parsing a ul that can have deeper levels like:
The idea is to get something like:
Any idea how to apply recursion?