<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
	<xsl:output method="html" indent="no" omit-xml-declaration="no" encoding="utf-8"
		cdata-section-elements="" media-type="text/html"
		doctype-public="-//W3C//DTD XHTML 1.1//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd" />
	<xsl:template match="/docs">
		<html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
			<title>网赢 <xsl:value-of select="@version"/> 操作手册  中文文档 </title>
			<link type="text/css" rel="stylesheet" rev="stylesheet" href="style.css" media="all" />
			<script type="text/javascript" src="js/jquery.js"></script>
			<script type="text/javascript" src="js/jquery-doc.js"></script>
		</head>
		<body id="docs">
			<div id="header">
				<div id="headerMain"><h1>网赢 V2.0操作手册 Powered <a href="http://www.teamtop.cn">Teamtop</a> </h1></div>
			</div>
			<div id="wrapper">
				<div id="sidebar">
					<xsl:for-each select="cat">
						<h2><xsl:value-of select="@value"/></h2>
						<ul>
							<xsl:if test="subcat">
								<xsl:for-each select="subcat">
									<li><xsl:value-of select="@value"/>
										<ul>
											<xsl:apply-templates select="action"/>
										</ul>
									</li>
								</xsl:for-each>
							</xsl:if>
							<xsl:if test="action">
								<ul>
									<xsl:apply-templates select="action"/>
								</ul>
							</xsl:if>
						</ul>
					</xsl:for-each>
				</div>
				<div id="content"></div>
			</div>
		</body>
		</html>
	</xsl:template>

	<xsl:template match="action">
		<li>
			<h2>
				<xsl:if test="self::action">
					<xsl:value-of select="@name"/>
				</xsl:if>
			</h2>
			<h3>使用方法</h3>
			<div class="desc">
				<p><xsl:value-of select="useTitle"/></p>
				<div class="longdesc">
					<pre><pre>
						<xsl:apply-templates select="usedesc"/>	
					</pre></pre>
				</div>
			</div>
			<xsl:if test="notes">
				<h3>注意事项</h3>
				<div>
					<xsl:for-each select="notes">
						<h4>
							<strong><xsl:value-of select="@name"/></strong>
						</h4>
						<pre>
							<xsl:value-of select="desc" disable-output-escaping="yes"/>
						</pre>
					</xsl:for-each>
				</div>
			</xsl:if>
			<xsl:if test="comparison">
				<h3>与其他对比</h3>
				<div>
					<xsl:for-each select="comparison">
						<h4>
							<strong><xsl:value-of select="@name"/></strong>
						</h4>
						<pre><xsl:value-of select="desc" disable-output-escaping="yes"/></pre>
					</xsl:for-each>
				</div>
			</xsl:if>
			<xsl:if test="other">
				<div class="example">
					<h3>其他信息</h3>
					<xsl:apply-templates select="other"/>
				</div>
			</xsl:if>
			<xsl:if test="action2">
			<ul class="lv3">
			<xsl:apply-templates select="action2"/>
			</ul>
			</xsl:if>
		</li>
	</xsl:template>

<xsl:template match="action2">
		<li>
			<h2>
				<xsl:if test="self::action2">
					<xsl:value-of select="@name"/>
				</xsl:if>
			</h2>
			<h3>使用方法</h3>
			<div class="desc">
				<p><xsl:value-of select="useTitle"/></p>
				<div class="longdesc">
					<pre><pre>
						<xsl:apply-templates select="usedesc"/>	
					</pre></pre>
				</div>
			</div>
			<xsl:if test="notes">
				<h3>注意事项</h3>
				<div>
					<xsl:for-each select="notes">
						<h4>
							<strong><xsl:value-of select="@name"/></strong>
						</h4>
						<pre>
							<xsl:value-of select="desc" disable-output-escaping="yes"/>
						</pre>
					</xsl:for-each>
				</div>
			</xsl:if>
			<xsl:if test="comparison">
				<h3>与其他对比</h3>
				<div>
					<xsl:for-each select="comparison">
						<h4>
							<strong><xsl:value-of select="@name"/></strong>
						</h4>
						<pre><xsl:value-of select="desc" disable-output-escaping="yes"/></pre>
					</xsl:for-each>
				</div>
			</xsl:if>
			<xsl:if test="other">
				<div class="example">
					<h3>其他信息</h3>
					<xsl:apply-templates select="other"/>
				</div>
			</xsl:if>
		</li>
	</xsl:template>
	

	<xsl:template match="other">
		<div class="other">
			<ul class="info">
				<xsl:if test="author"><li>作者：<xsl:value-of select="author"/></li></xsl:if>
				<xsl:if test="created"><li>文档创建时间：<xsl:value-of select="created"/></li></xsl:if>
				<xsl:if test="modified"><li>文档更新时间：<xsl:value-of select="modified"/></li></xsl:if>
			</ul>
		</div>
	</xsl:template>
	<xsl:template match="usedesc">
		<xsl:for-each select="*|text()">
		<xsl:choose>
		<xsl:when test="name()='image'">
		<img>
		<xsl:attribute name="u">
		<xsl:value-of select="."/>
		</xsl:attribute>
		</img>
		</xsl:when>
		<xsl:when test="name()='link'"><a><xsl:attribute name="linkto"><xsl:value-of select="@name"/></xsl:attribute><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="target">this</xsl:attribute><xsl:value-of select="."/></a></xsl:when>
		<xsl:otherwise>
		<xsl:value-of select="."/>
		</xsl:otherwise>
		</xsl:choose>
		</xsl:for-each>
	</xsl:template>

</xsl:stylesheet>

