merge
authorCameron McCormack <cam@mcc.id.au>
Wed, 16 May 2012 20:05:30 +1000
changeset 16 a0b9d7838b06
parent 15 d4cbdb7dd22c (current diff)
parent 6 fd5ea2f3c535 (diff)
child 17 ddeb27d7ebba
merge
publish.xsl
--- a/publish.xsl	Wed May 16 20:04:46 2012 +1000
+++ b/publish.xsl	Wed May 16 20:05:30 2012 +1000
@@ -16,7 +16,7 @@
                 version="2.0">
 
   <xsl:output method='text'/>
-  <xsl:output name='chapter' method='xml' omit-xml-declaration='yes' doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'/>
+  <xsl:output name='chapter' method='xml' omit-xml-declaration='yes' doctype-public='-//W3C//DTD XHTML 1.0 Transitional//EN' doctype-system='http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd' indent="yes" saxon:indent-spaces="1"/>
 
   <xsl:namespace-alias stylesheet-prefix='_xml' result-prefix='xml'/>
 
@@ -1058,17 +1058,19 @@
   </xsl:template>
 
   <xsl:template match='edit:example'>
+    <div class="example">
     <xsl:variable name='text' select='unparsed-text(resolve-uri(@href, base-uri(.)))'/>
     <pre class='xml'><xsl:value-of select='replace($text, "\s+$", "")'/></pre>
     <xsl:if test='@image="yes"'>
-      <table summary="Example {@title}">
-        <caption align="bottom">Example <xsl:value-of select="@name"/></caption>
-        <tr><td><img alt="Example {@name}{if (@description) then concat(' — ', @description) else ''}" src='{replace(@href, "\.svg$", ".png")}'/></td></tr>
-      </table>
+      <div class="figure">
+	<img alt="Example {@name}{if (@description) then concat(' — ', @description) else ''}" src='{replace(@href, "\.svg$", ".png")}'/>
+	<p class="caption">Example <xsl:value-of select="@name"/></p>
+      </div>
     </xsl:if>
     <xsl:if test='@link="yes"'>
       <p class='view-as-svg'><a href='{@href}'>View this example as SVG (SVG-enabled browsers only)</a></p>
     </xsl:if>
+    </div>
   </xsl:template>
 
   <xsl:template match='edit:includefile'>
@@ -1345,6 +1347,15 @@
     </table>
   </xsl:template>
 
+  <xsl:template match='edit:elementindex'>
+    <ul class='element-index' summary='Alphabetic list of elements'>
+      <xsl:for-each select='$defs//x:element'>
+        <xsl:sort select='@name'/>
+	<li><xsl:copy-of select='x:element-link(@name, .)'/></li>
+      </xsl:for-each>
+    </ul>
+  </xsl:template>
+
   <xsl:template match='edit:elementcategory'>
     <xsl:variable name='elementcategory' select='$defs/x:elementcategory[@name=current()/@name]'/>
     <xsl:variable name='all'>