List:Commits« Previous MessageNext Message »
From:mcbrown Date:July 1 2006 4:05am
Subject:svn commit - mysqldoc@docsrva: r2567 - in trunk: refman-4.1 xsl.d
View as plain text  
Author: mcbrown
Date: 2006-07-01 06:05:54 +0200 (Sat, 01 Jul 2006)
New Revision: 2567

Log:
Re-applied the new Q&A template style to the system.
Fixed the dbk-text.xsl transform so that it doesn't output a Node reference for tags of the form:

<link linkend="qandaitem">

This gets round the issue that the transform doesn't create Nodes for paragraphs with an ID (although these are perfectly valid in HTML and FO output for creating links). In fact, they don't make sense in an info file anyway, so removing them improves the layout/content of the file.

All other <link linkend...> constructs are unaffected. 



Modified:
   trunk/refman-4.1/exclusions-texi.xml
   trunk/xsl.d/dbk-prep.xsl
   trunk/xsl.d/dbk-texi.xsl

Modified: trunk/refman-4.1/exclusions-texi.xml
===================================================================
--- trunk/refman-4.1/exclusions-texi.xml	2006-07-01 03:08:25 UTC (rev 2566)
+++ trunk/refman-4.1/exclusions-texi.xml	2006-07-01 04:05:54 UTC (rev 2567)
@@ -1,4 +1,3 @@
 <?xml version="1.0"?>
 <idlist>
-
 </idlist>

Modified: trunk/xsl.d/dbk-prep.xsl
===================================================================
--- trunk/xsl.d/dbk-prep.xsl	2006-07-01 03:08:25 UTC (rev 2566)
+++ trunk/xsl.d/dbk-prep.xsl	2006-07-01 04:05:54 UTC (rev 2567)
@@ -95,28 +95,61 @@
 -->
 
 <xsl:template match="qandaset">
+<para><emphasis role="bold">Questions</emphasis></para>
+<itemizedlist>
   <xsl:apply-templates select="qandadiv/qandaentry/question
+                              |qandaentry/question" mode="toc"/>
+</itemizedlist>
+<para><emphasis role="bold">Questions and Answers</emphasis></para>
+  <xsl:apply-templates select="qandadiv/qandaentry/question
                               |qandaentry/question
                               |qandadiv/qandaentry/answer
                               |qandaentry/answer"/>
 </xsl:template>
 
+<xsl:template match="question" mode="toc">
+<listitem>
+<simpara>
+<link>
+<xsl:attribute name="linkend">
+<xsl:text>qandaitem-</xsl:text>
+<xsl:number
+             count="chapter|appendix|preface|section|sect1[@id]|sect2[@id]|sect3[@id]|sect4[@id]|sect5[@id]|qandaentry"
+             level="multiple"
+             format="1-1-1-1-1-1"
+             />
+</xsl:attribute>
+      <xsl:number
+             count="chapter|appendix|preface|section|sect1[@id]|sect2[@id]|sect3[@id]|sect4[@id]|sect5[@id]|qandaentry"
+             level="multiple"
+             format="1.1.1.1.1.1"
+             />:<xsl:text> </xsl:text><xsl:for-each select="*"><xsl:choose><xsl:when test="name() = 'para'"><xsl:apply-templates/></xsl:when><xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise></xsl:choose></xsl:for-each>
+</link>
+</simpara>
+</listitem>
+</xsl:template>
+
 <xsl:template match="question">
   <para>
+<xsl:attribute name="id">
+<xsl:text>qanda-</xsl:text>
+<xsl:number
+             count="chapter|appendix|preface|section|sect1[@id]|sect2[@id]|sect3[@id]|sect4[@id]|sect5[@id]|qandaentry"
+             level="multiple"
+             format="1-1-1-1-1-1"
+             />
+</xsl:attribute>
     <emphasis role="bold">
       <xsl:number
              count="chapter|appendix|preface|section|sect1[@id]|sect2[@id]|sect3[@id]|sect4[@id]|sect5[@id]|qandaentry"
              level="multiple"
              format="1.1.1.1.1.1"
-             />:
+             />:<xsl:text> </xsl:text><xsl:for-each select="*"><xsl:choose><xsl:when test="name() = 'para'"><xsl:apply-templates/></xsl:when><xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise></xsl:choose></xsl:for-each>
     </emphasis>
   </para>
-  <para>Question:</para>
-  <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="answer">
-  <para>Answer:</para>
   <xsl:apply-templates/>
 </xsl:template>
 

Modified: trunk/xsl.d/dbk-texi.xsl
===================================================================
--- trunk/xsl.d/dbk-texi.xsl	2006-07-01 03:08:25 UTC (rev 2566)
+++ trunk/xsl.d/dbk-texi.xsl	2006-07-01 04:05:54 UTC (rev 2567)
@@ -644,13 +644,18 @@
 </xsl:template>
 
 <!-- <link> -> @ref{} (use content as label) -->
+<!-- Now ignore items where the linked attribute includes 'qandaitem' 
+     to get round issue with nodes not being generated for paras with IDs
+     and not relevant in context of Texi file anyway. -->
 
 <xsl:template match="link">
-  <xsl:text>@ref{</xsl:text>
-  <xsl:value-of select="@linkend"/>
-  <xsl:text>,,</xsl:text>
-  <xsl:apply-templates select="@* | node()"/>
-  <xsl:text>}</xsl:text>
+  <xsl:if test="not(contains(@linkend,'qandaitem'))">
+    <xsl:text>@ref{</xsl:text>
+    <xsl:value-of select="@linkend"/>
+    <xsl:text>,,</xsl:text>
+    <xsl:apply-templates select="@* | node()"/>
+    <xsl:text>}</xsl:text>
+  </xsl:if>
 </xsl:template>
 
 <!-- <ulink> -> @uref{} -->

Thread
svn commit - mysqldoc@docsrva: r2567 - in trunk: refman-4.1 xsl.dmcbrown1 Jul