Hello,
So if I get it right, this is standard UL/LI menu but in case the Link document has any child documents, you need to pass another inner UL/LI menu, right?
I would do following (in pseudo-code):
a) Header transformation, 0 level:
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
b) Footer transformation, 0 level:
</ul>
</div>
c) Item transformation, 0 level:
if no child -> <li (if currently selected -> class="active")><a href="#">Link</a></li>
d) Header transformation, 1 level:
empty
e) Footer transformation, 1 level:
empty
f) First item transformation, 1 level:
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">sub document</a></li>
g) Last Item, 1 level:
<li><a href="#">One more separated link</a></li>
</ul>
h) Single item, 1 level:
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">sub document</a></li>
</ul>
i) Item transformation, 1 level:
<li><a href="#">sub document</a></li>
Best regards,
Jan Hermann