]> granicus.if.org Git - docbook-dsssl/commitdiff
also from twaugh:
authorMartijn van Beers <lotr@users.sourceforge.net>
Fri, 10 May 2002 15:26:23 +0000 (15:26 +0000)
committerMartijn van Beers <lotr@users.sourceforge.net>
Fri, 10 May 2002 15:26:23 +0000 (15:26 +0000)
I found some input that goes wrong with the synop.xsl we have in CVS:

<group choice="opt">
  <arg>-o <replaceable>FILE</replaceable></arg>
  <arg>--output=<replaceable>FILE</replaceable></arg>
</group>

It gets rendered as (with *bold* and _italic_):

[*-o FILE* | *--output=FILE*]

The desired markup should look like:
The following macro does the trick:

[\fB-o \fIFILE\fR\fR | \fB--output=\fIFILE\fR\fR]

The trouble is that the named template 'bold' uses value-of, and so
strips <replaceable> of its significance.

Another thing I found is that the arg/replaceable template is
superfluous altogether: db2man.xsl has a 'replaceable' template which
does the same thing.

Here is a patch to make those two modifications.

NOTE TO SELF: must try to fix bold template so we can use it everywhere

contrib/xsl/db2man/synop.xsl

index aa3e95e0f3d0199d0711327871df75011f0818e5..e657f8fdb198dd5e0726aa7c0385c13002ea45b7 100644 (file)
   <xsl:if test="position()>1">
     <xsl:value-of select="$arg.or.sep"/>
   </xsl:if>
-  <xsl:apply-templates mode="bold" select="."/>
+  <!-- Don't use the 'bold' named template here since there may be -->
+  <!-- child elements that require different markup (such as       -->
+  <!-- <replaceable>).                                             -->
+  <xsl:text>\fB</xsl:text>
+  <xsl:apply-templates/>
+  <xsl:text>\fR</xsl:text>
 </xsl:template>
 
 <xsl:template match="command">
   <xsl:apply-templates mode="bold" select="."/>
 </xsl:template>
 
-<xsl:template match="arg/replaceable">
-  <xsl:apply-templates mode="italic" select="."/>
-</xsl:template>
-
 <xsl:template match="parameter[not(ancestor::command)]">
   <xsl:apply-templates mode="italic" select="."/>
 </xsl:template>