]> granicus.if.org Git - docbook-dsssl/commitdiff
Improve handling of abstract, add comment indicating conversion path to output.
authorNorman Walsh <ndw@nwalsh.com>
Wed, 6 Feb 2008 12:57:11 +0000 (12:57 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 6 Feb 2008 12:57:11 +0000 (12:57 +0000)
docbook/relaxng/tools/db4-upgrade.xsl

index e9320c1acbb919750bfe079e1953016be425b543..6281c1e32722c4849153e3ed648952f678fcbbf6 100644 (file)
 # ======================================================================
 -->
 
+<xsl:variable name="version" select="'1.0'"/>
+
 <xsl:output method="xml" encoding="utf-8" indent="no" omit-xml-declaration="yes"/>
+
 <xsl:preserve-space elements="*"/>
 <xsl:param name="rootid">
   <xsl:choose>
   <xsl:variable name="converted">
     <xsl:apply-templates/>
   </xsl:variable>
+  <xsl:comment>
+    <xsl:text> Converted by db4-upgrade version </xsl:text>
+    <xsl:value-of select="$version"/>
+    <xsl:text> </xsl:text>
+  </xsl:comment>
+  <xsl:text>&#10;</xsl:text>
   <xsl:apply-templates select="exsl:node-set($converted)/*" mode="addNS"/>
 </xsl:template>
 
             <xsl:apply-templates select="title" mode="copy"/>
             <xsl:apply-templates select="titleabbrev" mode="copy"/>
             <xsl:apply-templates select="subtitle" mode="copy"/>
+            <xsl:apply-templates select="abstract" mode="copy"/>
           </info>
         </xsl:if>
         <xsl:apply-templates/>
         <xsl:apply-templates select="title" mode="copy"/>
         <xsl:apply-templates select="titleabbrev" mode="copy"/>
         <xsl:apply-templates select="subtitle" mode="copy"/>
+        <xsl:apply-templates select="abstract" mode="copy"/>
       </info>
     </xsl:if>
     <xsl:apply-templates/>
              priority="200">
   <simplesect>
     <xsl:call-template name="copy.attributes"/>
-
-    <xsl:if test="not(sect1info|sect2info|sect3info|sect4info|sect5info|sectioninfo)">
-      <info>
-        <xsl:apply-templates select="title" mode="copy"/>
-        <xsl:apply-templates select="titleabbrev" mode="copy"/>
-        <xsl:apply-templates select="subtitle" mode="copy"/>
-      </info>
-    </xsl:if>
+    <info>
+      <xsl:apply-templates select="title" mode="copy"/>
+      <xsl:apply-templates select="titleabbrev" mode="copy"/>
+      <xsl:apply-templates select="subtitle" mode="copy"/>
+      <xsl:apply-templates select="abstract" mode="copy"/>
+    </info>
     <xsl:apply-templates/>
   </simplesect>
 </xsl:template>
         <xsl:apply-templates select="title" mode="copy"/>
         <xsl:apply-templates select="titleabbrev" mode="copy"/>
         <xsl:apply-templates select="subtitle" mode="copy"/>
+        <xsl:apply-templates select="abstract" mode="copy"/>
       </info>
     </xsl:if>
     <xsl:apply-templates/>
   <!-- nop -->
 </xsl:template>
 
+<xsl:template match="abstract" priority="300">
+  <xsl:if test="not(contains(name(parent::*),'info'))">
+    <xsl:call-template name="emit-message">
+      <xsl:with-param name="message">
+       <xsl:text>Check abstract; moved into info correctly?</xsl:text>
+      </xsl:with-param>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
 <xsl:template match="indexterm">
   <!-- don't copy the defaulted significance='normal' attribute -->
   <indexterm>