]> granicus.if.org Git - docbook-dsssl/commitdiff
Stop discarding caption; support olink
authorNorman Walsh <ndw@nwalsh.com>
Sat, 23 Apr 2005 15:47:34 +0000 (15:47 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Sat, 23 Apr 2005 15:47:34 +0000 (15:47 +0000)
docbook/relaxng/tools/db4-upgrade.xsl

index 0beb1ac12b591c9c06ab767fd0e84d515b93d4d2..8599d54bb7dc1adf772ad8afbe8b00a412fde472 100644 (file)
   </mediaobject>
 </xsl:template>
 
-<xsl:template match="mediaobject/caption" priority="200">
-  <xsl:message>
-    <xsl:text>Discarding caption (</xsl:text>
-    <xsl:value-of select="."/>
-    <xsl:text>).</xsl:text>
-  </xsl:message>
-</xsl:template>
-
 <xsl:template match="remark" priority="200">
   <!-- get rid of any embedded markup -->
   <remark>
   </xsl:choose>
 </xsl:template>
 
+<xsl:template match="olink" priority="200">
+  <xsl:if test="@linkmode">
+    <xsl:message>
+      <xsl:text>Discarding linkmode on olink.</xsl:text>
+    </xsl:message>
+  </xsl:if>
+
+  <xsl:choose>
+    <xsl:when test="@targetdocent">
+      <xsl:message>
+       <xsl:text>Converting olink targetdocent to targetdoc.</xsl:text>
+      </xsl:message>
+
+      <olink targetdoc="{unparsed-entity-uri(@targetdocent)}">
+       <xsl:for-each select="@*">
+         <xsl:if test="name(.) != 'targetdocent'
+                       and name(.) != 'linkmode'">
+           <xsl:copy/>
+         </xsl:if>
+       </xsl:for-each>
+       <xsl:apply-templates/>
+      </olink>
+    </xsl:when>
+    <xsl:otherwise>
+      <olink>
+       <xsl:for-each select="@*">
+         <xsl:if test="name(.) != 'linkmode'">
+           <xsl:copy/>
+         </xsl:if>
+       </xsl:for-each>
+       <xsl:apply-templates/>
+      </olink>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template match="biblioentry/firstname
                      |biblioentry/surname
                      |biblioentry/othername