OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Gentext for performance="optional"?

I use a template that placed a "checkbox" in front of the procedure step. You probably could adapt this template to do what you need.
Dean Nelson
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY CHECKBOX1 "&#x2610;"> <!-- white square -->
<!ENTITY CHECKBOX2 "&#x2611;"> <!-- white square with check in it-->
<!ENTITY CHECKBOX3 "&#x25A1;"> <!-- white square -->
<!ENTITY CHECKBOX4 "&#x25A2;"> <!-- white square with rounded corners -->
<!ENTITY CHECKBOX5 "&#x2B1A;"> <!-- large white square -->
<!ENTITY CHECKBOX6 "&#x25EF;"> <!-- white circle -->
<!ENTITY CHECKBOXSQ "[ ]"> <!-- brackets -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:fo="http://www.w3.org/1999/XSL/Format" >
   <!-- This template places a checkbox before each step in a procedure
        if the procedure has a role="check" attribute. If the procedure also
        has a step with a role="nocheck" that step will be rendered without a
        This is only accomplished if the parameter "met.procedure.checkbox" is not empty.
    <xsl:param name="met.procedure.checkbox">1</xsl:param>
    <xsl:param name="met.procedure.checkbox.type">&CHECKBOX1;</xsl:param>
    <xsl:param name="met.procedure.checkbox.size">100%</xsl:param>

  <xsl:template match="procedure[@role='check']//step">
    <xsl:variable name="id">
      <xsl:call-template name="object.id"/>
    <fo:list-item  xsl:use-attribute-sets="list.item.spacing">
      <fo:list-item-label end-indent="label-end()">
  <fo:block id="{$id}">
            <xsl:when test="count(../step) = 1">
                <xsl:when test="$met.procedure.checkbox != '' and not(@role='nocheck')">
                  <fo:block font-weight="bold" margin-left="-0.5cm" >
     <fo:inline vertical-align="middle" font-size="{$met.procedure.checkbox.size}">
      <xsl:value-of select="$met.procedure.checkbox.type"/>
                    <xsl:apply-templates select="." mode="number">
                      <xsl:with-param name="recursive" select="0"/>
                  <xsl:apply-templates select="." mode="number">
                    <xsl:with-param name="recursive" select="0"/>
                  </xsl:apply-templates>. </xsl:otherwise>
      <fo:list-item-body start-indent="body-start()">
In a message dated 4/8/2013 2:22:04 P.M. Pacific Daylight Time, nordlund@cray.com writes:

Hello docbook-apps. I’ve been beating my head against the wall for a while on this one now and I’m hoping I can get a quick answer here.


I have some procedural steps that have the performance=”optional” attribute on them, and I want to have some generated text such as “(Optional) “ to appear before the step text so readers know that the step is optional. I can’t find anything anywhere regarding the styling of step in this fashion. Any ideas? I’m hoping there is a parameter I can set to make it easy, otherwise I can customize a template to insert the text based on an if statement.


How do you guys do this?


Eric Nordlund

Customer Documentation and Training

Cray Inc.

901 5th Ave

Seattle, WA 98164



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]