List Info

Thread: setting font to terms of variablelist




setting font to terms of variablelist
user name
2007-07-17 03:19:58
Hi !

I would like the terms of the variablelists to look like varname. As I have many variablelists, it's heavy to add the varname markup at each variable, so I wonder if it is possible to set the font to those elements in my custom xsl stylesheet ?
I would like to do it in the html output and the pdf output, which I generate via fop 0.93.
I'm using DocBook stylesheets 1.72 ; I've tried to look in lists.xml but don't find if and where I could do it...

thanks,
Marie.
Re: setting font to terms of variablelist
user name
2007-07-17 13:39:20
El Martes, 17 de Julio de 2007 10:19, Marie Sauvage - EBM
WebSourcing 
escribió:
> Hi !
>
>  I would like the terms of the variablelists to look
like varname. As I
> have many variablelists, it's heavy to add the varname
markup at each
> variable, so I wonder if it is possible to set the font
to those elements
> in my custom xsl stylesheet ? I would like to do it in
the html output and
> the pdf output, which I generate via fop 0.93. I'm
using DocBook
> stylesheets 1.72 ; I've tried to look in lists.xml but
don't find if and
> where I could do it...

Try this.

For FO:

<xsl:template match="varlistentry/term">
  <fo:inline
xsl:use-attribute-sets="monospace.properties">
    <xsl:call-template name="simple.xlink">
      <xsl:with-param name="content">
        <xsl:apply-templates/>
      </xsl:with-param>
    </xsl:call-template>
  </fo:inline>
  <xsl:choose>
    <xsl:when
test="not(following-sibling::term)"/>
    <xsl:otherwise>
      <fo:inline><xsl:value-of
                    
select="$variablelist.term.separator"/></fo:
inline>
      <xsl:if
test="not($variablelist.term.break.after =
'0')">
        <fo:block/>
      </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

For HTML you can customize the tagging like this:

<xsl:template match="varlistentry/term">
  <code class="term">
    <xsl:call-template name="anchor"/>
    <xsl:call-template name="simple.xlink">
      <xsl:with-param name="content">
        <xsl:apply-templates/>
      </xsl:with-param>
    </xsl:call-template>
    <xsl:choose>
      <xsl:when test="position() = last()"/>

      <xsl:otherwise>
        <xsl:value-of
select="$variablelist.term.separator"/>
        <xsl:if
test="not($variablelist.term.break.after =
'0')">
          <br/>
        </xsl:if>
      </xsl:otherwise>
    </xsl:choose>
  </code>
</xsl:template>

or, if using a CSS file to style the HTMLs, just add this
snip to it:

span.term { font-family: monospace; }



-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfroms
cratch.org
LFS en castellano: http://www.escomp
oslinux.org/lfs-es http://www.lfs-es.info
TLDP-ES:                           http://es.tldp.org

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org


Re: setting font to terms of variablelist
user name
2007-07-18 02:11:01
great , it works perfectly !
thank you very much

shame on me, I could have think of the .css for the html output...

Regards,
Marie.

M.Canales.es a écrit :
macana-es.com" type="cite">
El Martes, 17 de Julio de 2007 10:19, Marie Sauvage - EBM WebSourcing 
escribió:
  
Hi !

 I would like the terms of the variablelists to look like varname. As I
have many variablelists, it's heavy to add the varname markup at each
variable, so I wonder if it is possible to set the font to those elements
in my custom xsl stylesheet ? I would like to do it in the html output and
the pdf output, which I generate via fop 0.93. I'm using DocBook
stylesheets 1.72 ; I've tried to look in lists.xml but don't find if and
where I could do it...
    

Try this.

For FO:

<;xsl:template match="varlistentry/term">
  <fo:inline xsl:use-attribute-sets="monospace.properties">
    <xsl:call-template name="simple.xlink"&gt;
      <xsl:with-param name="content">
        <xsl:apply-templates/>
      </xsl:with-param&gt;
    </xsl:call-template>
  </fo:inline>
  <xsl:choose>
    <xsl:when test="not(following-sibling::term)"/>
    <xsl:otherwise>
      <fo:inline><xsl:value-of
                     select="$variablelist.term.separator"/>&lt;/fo:inline>
      <xsl:if test="not($variablelist.term.break.after = '0')">

        <fo:block/>
      </xsl:if>
    </xsl:otherwise>;
  </xsl:choose>
</xsl:template>


For HTML you can customize the tagging like this:

&lt;xsl:template match="varlistentry/term">
  <code class="term">
    <xsl:call-template name="anchor"/>
    <xsl:call-template name="simple.xlink"&gt;
      <xsl:with-param name="content">
        <xsl:apply-templates/>
      </xsl:with-param&gt;
    </xsl:call-template>
    <xsl:choose>
      <xsl:when test="position() = last()"/&gt; 
      <xsl:otherwise>
        <xsl:value-of select="$variablelist.term.separator"/>

        <xsl:if test="not($variablelist.term.break.after = '0')">

          <br/>;
        </xsl:if>
      </xsl:otherwise>;
    </xsl:choose>
  </code&gt;
</xsl:template>

or, if using a CSS file to style the HTMLs, just add this snip to it:

span.term { font-family: monospace; }



  
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )