]> granicus.if.org Git - docbook-dsssl/commitdiff
Convert class to type on refmiscinfo; fix bug in title support for reference; support...
authorNorman Walsh <ndw@nwalsh.com>
Fri, 3 Mar 2006 10:31:51 +0000 (10:31 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 3 Mar 2006 10:31:51 +0000 (10:31 +0000)
docbook/relaxng/tools/db4-upgrade.xsl

index 08dee44732f5cbc1b97b8d68937279d893509fa7..86e5c4e914e1775e8ae8e6dfb7291f9bf58e483d 100644 (file)
   </info>
 </xsl:template>
 
+<xsl:template match="refmiscinfo"
+              priority="200">
+  <refmiscinfo>
+    <xsl:call-template name="copy.attributes">
+      <xsl:with-param name="suppress" select="'class'"/>
+    </xsl:call-template>
+    <xsl:if test="@class">
+      <xsl:attribute name="type">
+       <xsl:copy-of select="@class"/>
+      </xsl:attribute>
+    </xsl:if>
+    <xsl:apply-templates/>
+  </refmiscinfo>
+</xsl:template>
+
 <xsl:template match="corpauthor" priority="200">
   <author>
     <xsl:call-template name="copy.attributes"/>
 
 <xsl:template match="dedication|preface|chapter|appendix|part|partintro
                      |article|bibliography|glossary|glossdiv|index
+                    |reference[not(referenceinfo)]
                      |book" priority="200">
   <xsl:choose>
-    <xsl:when test="not(dedicationinfo|prefaceinfo|chapterinfo|appendixinfo|partinfo
-                        |articleinfo|artheader|bibliographyinfo|glossaryinfo|indexinfo
+    <xsl:when test="not(dedicationinfo|prefaceinfo|chapterinfo
+                       |appendixinfo|partinfo
+                        |articleinfo|artheader|bibliographyinfo
+                       |glossaryinfo|indexinfo
                         |bookinfo)">
       <xsl:copy>
         <xsl:call-template name="copy.attributes"/>
     <xsl:if test="@srccredit">
       <xsl:message>
         <xsl:text>Check conversion of srccredit </xsl:text>
-        <xsl:text>(othercredit role="srccredit").</xsl:text>
+        <xsl:text>(othercredit="srccredit").</xsl:text>
       </xsl:message>
       <info>
-        <othercredit role="srccredit">
+        <othercredit class="other" otherclass="srccredit">
           <orgname>???</orgname>
           <contrib>
             <xsl:value-of select="@srccredit"/>
 <xsl:template match="sgmltag" priority="200">
   <tag>
     <xsl:call-template name="copy.attributes"/>
+    <xsl:if test="@class = 'sgmlcomment'">
+      <xsl:attribute name="class">comment</xsl:attribute>
+    </xsl:if>
     <xsl:apply-templates/>
   </tag>
 </xsl:template>
 </xsl:template>
 
 <xsl:template match="pubsnumber" priority="200">
-  <biblioid class="pubnumber">
+  <biblioid class="pubsnumber">
     <xsl:call-template name="copy.attributes"/>
     <xsl:apply-templates/>
   </biblioid>
                 select="preceding-sibling::contractnum|following-sibling::contractnum"/>
 
   <xsl:message>
-   <xsl:text>Converting contractsponsor to othercredit role="contractsponsor".</xsl:text>
+   <xsl:text>Converting contractsponsor to othercredit="contractsponsor".</xsl:text>
   </xsl:message>
 
-  <othercredit role="contractsponsor">
+  <othercredit class="other" otherclass="contractsponsor">
     <orgname>
       <xsl:call-template name="copy.attributes"/>
       <xsl:apply-templates/>
                     |following-sibling::contractsponsor)
                 and not(preceding-sibling::contractnum)">
     <xsl:message>
-      <xsl:text>Converting contractnum to othercredit role="contractnum".</xsl:text>
+      <xsl:text>Converting contractnum to othercredit="contractnum".</xsl:text>
     </xsl:message>
 
-    <othercredit role="contractnum">
+    <othercredit class="other" otherclass="contractnum">
       <orgname>???</orgname>
       <xsl:for-each select="self::contractnum
                             |preceding-sibling::contractnum
                      |bibliomixed/contrib" priority="200">
   <xsl:message>
     <xsl:text>Check conversion of contrib </xsl:text>
-    <xsl:text>(othercontrib role="contrib").</xsl:text>
+    <xsl:text>(othercontrib="contrib").</xsl:text>
   </xsl:message>
-  <othercredit>
+  <othercredit class="other" otherclass="contrib">
     <orgname>???</orgname>
     <contrib>
       <xsl:call-template name="copy.attributes"/>
          </xsl:otherwise>
        </xsl:choose>
       </xsl:when>
+      <xsl:when test="local-name(.) = 'entityref'">
+       <xsl:attribute name="fileref">
+         <xsl:value-of select="unparsed-entity-uri(@entityref)"/>
+       </xsl:attribute>
+      </xsl:when>
       <xsl:otherwise>
         <xsl:copy/>
       </xsl:otherwise>
       <xsl:element name="{local-name(.)}"
                   namespace="http://docbook.org/ns/docbook">
        <xsl:if test="not(parent::*)">
-         <xsl:attribute name="version">lillet</xsl:attribute>
+         <xsl:attribute name="version">5.0</xsl:attribute>
        </xsl:if>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates mode="addNS"/>
     <xsl:otherwise>
       <xsl:copy>
        <xsl:if test="not(parent::*)">
-         <xsl:attribute name="version">lillet</xsl:attribute>
+         <xsl:attribute name="version">5.0</xsl:attribute>
        </xsl:if>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates mode="addNS"/>