]> granicus.if.org Git - docbook-dsssl/commitdiff
Add verbose param to subtitle.markup templates to allow its
authorBob Stayton <bobs@sagehill.net>
Tue, 21 Jun 2011 16:51:51 +0000 (16:51 +0000)
committerBob Stayton <bobs@sagehill.net>
Tue, 21 Jun 2011 16:51:51 +0000 (16:51 +0000)
error message to be ignored.
Add that param to fop1.xsl application of subtitle.markup
to avoid unnecessary error message in document information.

xsl/common/subtitles.xsl
xsl/fo/fop1.xsl

index 09f7176ce823330f6e3554363847693690b56dfa..d497daf6881da5dc22c65a43574da2e854f763bc 100644 (file)
@@ -29,47 +29,58 @@ subtitle of the element.
 </doc:mode>
 
 <xsl:template match="*" mode="subtitle.markup">
-  <xsl:message>
-    <xsl:text>Request for subtitle of unexpected element: </xsl:text>
-    <xsl:value-of select="local-name(.)"/>
-  </xsl:message>
-  <xsl:text>???SUBTITLE???</xsl:text>
+  <xsl:param name="verbose" select="1"/>
+  <xsl:if test="$verbose != 0">
+    <xsl:message>
+      <xsl:text>Request for subtitle of unexpected element: </xsl:text>
+      <xsl:value-of select="local-name(.)"/>
+    </xsl:message>
+    <xsl:text>???SUBTITLE???</xsl:text>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template match="subtitle" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates/>
 </xsl:template>
 
 <xsl:template match="set" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(setinfo/subtitle|info/subtitle|subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="book" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(bookinfo/subtitle|info/subtitle|subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="part" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(partinfo/subtitle
                                 |docinfo/subtitle
                                 |info/subtitle
                                 |subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="preface|chapter|appendix" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(docinfo/subtitle
                                 |info/subtitle
                                 |prefaceinfo/subtitle
@@ -78,54 +89,65 @@ subtitle of the element.
                                 |subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="article" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(artheader/subtitle
                                 |articleinfo/subtitle
                                 |info/subtitle
                                 |subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="dedication|colophon" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(subtitle|info/subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="reference" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(referenceinfo/subtitle
                                 |docinfo/subtitle
                                 |info/subtitle
                                 |subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="qandaset" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(blockinfo/subtitle|info/subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
 <xsl:template match="refentry" mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(refentryinfo/subtitle
                                 |info/subtitle
                                 |docinfo/subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
@@ -135,6 +157,7 @@ subtitle of the element.
                      |simplesect"
               mode="subtitle.markup">
   <xsl:param name="allow-anchors" select="'0'"/>
+  <xsl:param name="verbose" select="1"/>
   <xsl:apply-templates select="(info/subtitle
                                 |sectioninfo/subtitle
                                 |sect1info/subtitle
@@ -148,6 +171,7 @@ subtitle of the element.
                                 |subtitle)[1]"
                        mode="subtitle.markup">
     <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
+    <xsl:with-param name="verbose" select="$verbose"/>
   </xsl:apply-templates>
 </xsl:template>
 
index bb1ead6ed0b4232a94f3b4b0a406a7eb2bcf1d17..46d18b9482b475b4022f2602379799a8f0e6cf93 100644 (file)
     <xsl:apply-templates select="/*[1]" mode="label.markup"/>
     <xsl:apply-templates select="/*[1]" mode="title.markup"/>
     <xsl:variable name="subtitle">
-      <xsl:apply-templates select="/*[1]" mode="subtitle.markup"/>
+      <xsl:apply-templates select="/*[1]" mode="subtitle.markup">
+        <xsl:with-param name="verbose" select="0"/>
+      </xsl:apply-templates>
     </xsl:variable>
     <xsl:if test="$subtitle !=''">
       <xsl:text> - </xsl:text>