----》》XML 文件
<?xml version="1.0" encoding="utf-8"?>
<ui>
<navigations>
<items>
<title><![CDATA[HOME]]></title>
<levels><![CDATA[1]]></levels>
</items>
<items>
<title><![CDATA[CATEGORIES]]></title>
<levels><![CDATA[1]]></levels>
<item>
<title><![CDATA[Cuisines]]></title>
<levels><![CDATA[2]]></levels>
</item>
<item>
<title><![CDATA[Vogue]]></title>
<levels><![CDATA[2]]></levels>
<item>
<title><![CDATA[World News]]></title>
<levels><![CDATA[3]]></levels>
</item>
</item>
<item>
<title><![CDATA[Tidbits]]></title>
<levels><![CDATA[2]]></levels>
</item>
</items>
<items>
<title><![CDATA[Style Guide]]></title>
<levels><![CDATA[1]]></levels>
</items>
</navigations>
</ui>
------》》xsl 适配代码
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xmlns:fun="sys:fun" >
<xsl:output method="xhtml" version="1.0" omit-xml-declaration="yes" encoding="utf-8" media-type="text/html" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<!--菜单-->
<xsl:template name="SubItem">
<xsl:for-each select="./*">
<xsl:if test="count(./*)>0">
<li>
<xsl:value-of select="title"/>
<xsl:call-template name="SubItem"/>
</li>
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template name="Menu">
<ul>
<xsl:for-each select="navigations/items">
<li>
<xsl:value-of select="title"/>
<xsl:call-template name="SubItem"/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="ui">
<div class="menu">
<!--菜单-->
<xsl:call-template name="Menu"/>
<!--菜单完-->
</div>
</xsl:template>
</xsl:stylesheet>
-----》》输出的结果
<div class="menu" xmlns="http://www.w3.org/1999/xhtml" fun="sys:fun">
<ul>
<li>HOME</li>
<li>CATEGORIES<li>Cuisines</li><li>Vogue<li>World News</li></li><li>Tidbits</li></li>
<li>Style Guide</li>
</ul>
</div>
---》》》想要的结果
<div class="menu" xmlns="http://www.w3.org/1999/xhtml" fun="sys:fun">
<ul>
<li>HOME</li>
<li>CATEGORIES
<ul>
<li>Cuisines</li>
<li>Vogue
<ul>
<li>World News</li>
</ul>
</li>
<li>Tidbits</li>
</ul>
</li>
<li>Style Guide</li>
</ul>
</div>
这个<ul> 标签要怎么加才对。我尝试了好多,都是不对的