diff html.xsl @ 13:2925b0e246c6 default tip

Fix a lot of things, and add a TODO.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 17 Feb 2012 12:54:08 +0100
parents 79dfd9765a67
children
line wrap: on
line diff
--- a/html.xsl
+++ b/html.xsl
@@ -33,7 +33,13 @@
 			</x:if>
 		</h3>
 		
+		<x:variable name="ref" select="o:params/@ref"/>
 		<x:choose>
+			<x:when test="o:params/@ref">
+				<x:call-template name="params">
+					<x:with-param name="params" select="/o:opcodes/o:op[o:num = $ref]/o:params/o:param"/>
+				</x:call-template>
+			</x:when>
 			<x:when test="o:params">
 				<x:apply-templates select="o:params"/>
 			</x:when>
@@ -45,17 +51,18 @@
 		<x:apply-templates select="o:desc"/>
 	</x:template>
 
-	<x:template match="o:params">
+	<x:template name="params" match="o:params">
+		<x:param name="params" select="o:param"/>
 		<table>
 			<tr>
 				<th>Type</th>
-				<x:if test="o:param/@name"><th>Name</th></x:if>
-				<x:if test="o:param/@unit"><th>Unit</th></x:if>
-				<x:if test="o:param/@var"><th>Variable</th></x:if>
-				<x:if test="o:param != ''"><th>Notes</th></x:if>
-				<x:if test="o:param/@values"><th>Values</th></x:if>
+				<x:if test="$params/@name"><th>Name</th></x:if>
+				<x:if test="$params/@unit"><th>Unit</th></x:if>
+				<x:if test="$params/@var"><th>Variable</th></x:if>
+				<x:if test="$params != ''"><th>Notes</th></x:if>
+				<x:if test="$params/@values"><th>Values</th></x:if>
 			</tr>
-			<x:apply-templates select="o:param"/>
+			<x:apply-templates select="$params"/>
 		</table>
 	</x:template>
 
@@ -97,14 +104,18 @@
 	</x:template>
 
 	<x:template match="o:desc">
+		<p>
 		<x:choose>
-			<x:when test="count(*) &gt; 1">
-				<x:apply-templates/>
+			<x:when test="h:div">
+				<x:for-each select="h:div/*">
+					<x:call-template name="xhtml"/>
+				</x:for-each>
 			</x:when>
 			<x:otherwise>
-				<p><x:apply-templates/></p>
+				<x:apply-templates/>
 			</x:otherwise>
 		</x:choose>
+		</p>
 	</x:template>
 
 	<x:template name="xhtml" match="node() | @*">