几天来我一直在绞尽脑汁,而对于我的一生,我无法弄清楚如何做到这一点。采用以下 XML:
<Root>
<container>
<widget type="nav">
<links>
<tab type="label" header="Top Level Tab1"/>
<tab type="page" header="submenu of tab1"/>
<tab type="page" header="submenu of tab1"/>
<tab type="page" header="submenu of tab1"/>
<tab type="label" header="Top Level Tab2"/>
<tab type="page" header="submenu of tab2"/>
<tab type="page" header="submenu of tab2"/>
<tab type="page" header="submenu of tab2"/>
<tab type="page" header="submenu of tab2"/>
<tab type="page" header="submenu of tab2"/>
<tab type="label" header="Top Level Tab3"/>
<tab type="page" header="submenu of tab3"/>
<tab type="page" header="submenu of tab3"/>
<tab type="page" header="submenu of tab3"/>
<tab type="page" header="submenu of tab3"/>
<tab type="page" header="submenu of tab3"/>
</links>
</widget>
</container>
</root>
我需要做的是将其转换为导航区域,在每个选项卡上使用“标签”类型分隔,并将以下兄弟姐妹放在其下。例如
<ul>
<li>
<a href="link for label">Top Level Header1</a>
<div class="submenu">
<ul>
<li>Submenu Link 1</li>
<li>Submenu Link 1</li>
<li>Submenu Link 1</li>
</ul>
</div>
</li>
<li>
<a href="link for label">Top Level Header2</a>
<div class="submenu">
<ul>
<li>Submenu Link 2</li>
<li>Submenu Link 2</li>
<li>Submenu Link 2</li>
</ul>
</div>
</li>
<li>
<a href="link for label">Top Level Header3</a>
<div class="submenu">
<ul>
<li>Submenu Link 3</li>
<li>Submenu Link 3</li>
<li>Submenu Link 3</li>
</ul>
</div>
</li>
</ul>
任何指导肯定会受到赞赏