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: formatting for paragraphs with xsl stylesheets

It seems that the xsl stylesheets have a shortcoming for formatting paragraphs. Whereas all other elements have an attribute set, para does not.

In order to set formatting properties, one has to use the section.properties attribute set. But then titles inherit this property as well. For example:

    <xsl:attribute-set name="section.properties">
      <xsl:attribute name="text-indent">12pt</attribute>
    </xsl:attribute-set name>

Ends up indenting the title as well. In order to get around that, I have to set the text-indent on the title properties to 0; that seems like a clumsy workaround. In addition, the lack of formatting for paragraphs does not allow you to indent paragraphs in certain situations. For example, some styles don't indent the first paragraph after a title.

The code below is my workaround. Is there a better way? If not, I would consider submitting a patch (in which case the code would be more sophisticated to handle more complicated situations)

 <!--indent first paragraph-->
    <xsl:template match="d:para">
        <xsl:variable name="keep.together">
            <xsl:call-template name="pi.dbfo_keep-together"/>
        <fo:block xsl:use-attribute-sets="normal.para.spacing">
            <xsl:if test="$keep.together != ''">
                <xsl:attribute name="keep-together.within-column">
                    <xsl:value-of select="$keep.together"/>
            <xsl:if test="preceding-sibling::d:para">
                <xsl:attribute name="text-indent">
                    <xsl:value-of select="$text-indent"/>
            <xsl:call-template name="anchor"/>


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