The problem is that the XSL-FO property text-indent is an inherited
property. That means it is applied to any fo:block elements contained in
the para's fo:block. That's why the fo:block containing your programlisting
text also has that property, even though it doesn't show in the FO file.
The other complication is that para allows both inline and block elements,
as well as text, so it can be difficult to sort out how to apply a solution
to subelements of para.
You might try this oversimplified solution using fo:wrapper to turn off the
text-indent for all subelements:
<xsl:template match="section/para/*">
<fo:wrapper text-indent="0pt">
<xsl:apply-imports/>
</fo:wrapper>
</xsl:template>
This wraps any subelement output in an fo:wrapper to reset the text-indent
property. It then uses xsl:apply-imports to apply the stock DocBook template
for each subelement. However, if you have a customization of one of those
subelements, then the apply-imports will ignore that customization and go
back to the original stock template. So any customized templates for such
elements must also have this solution. Not pretty, and there are probably
situations where it won't work properly.
Bob Stayton
Sagehill Enterprises
[email protected]
----- Original Message -----
From: "Dongsheng Song" <[email protected]>
To: "DocBook Apps" <[email protected]>
Sent: Monday, December 29, 2008 1:34 AM
Subject: [docbook-apps] I'm want to indent only 'section/para', not
'section/para/programlisting'
When I use custom xsl to indent 'section/para':
<xsl:attribute-set name="standard.para.spacing"
use-attribute-sets="normal.para.spacing">
<xsl:attribute name="text-indent">24pt</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="section/para">
<fo:block xsl:use-attribute-sets="standard.para.spacing">
<xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
But 'section/para/programlisting' indent too, how can I avoid it indent
any
subelements of 'section/para'?
Thanks,
Dongsheng Song
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]