if you are a human please do not click here
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Username :
Password :
Home
Help
Calendar
Register
Login
XMetaL Community Forums
»
General
»
DITA and XMetaL Discussion
»
Adjustment for <p> formatting when nested in other elements
Pages:
1
« previous
next »
Print
Author
Topic: Adjustment for <p> formatting when nested in other elements (Read 792 times)
dduffy
Member
Posts: 10
Adjustment for <p> formatting when nested in other elements
«
on:
April 21, 2010, 11:11:52 AM »
We had modified the fo/attrs/custom.xsl file to add space after the <p> as follows:
<xsl:attribute-set name="p">
<xsl:attribute name="text-indent">0em</xsl:attribute>
<xsl:attribute name="padding-before">6pt</xsl:attribute>
<xsl:attribute name="padding-after">6pt</xsl:attribute>
<xsl:attribute name="space-after.optimum">3pt</xsl:attribute>
<xsl:attribute name="space-before">0pt</xsl:attribute>
<xsl:attribute name="space-after">0pt</xsl:attribute>
</xsl:attribute-set>
This works great in PDF for when the <p> stands alone but when it is nested within other elements, such as an <li> tag, the space after is too large and we would like to reset it to 0em. I have tried several workarounds trying to adjus the ul.li__body statements without avail.
Does anyone have advice on adding an <xsl:template match= to the fo/xsl/custom.xsl that could allow for such exceptions or would code have to be written for each exception?
Logged
severin.foreman
Member
Posts: 29
Re: Adjustment for <p> formatting when nested in other elements
«
Reply #1 on:
April 21, 2010, 11:23:31 AM »
I think something like the following would override the attribute set value for space-after.optimum.
<xsl:template match="*[contains(@class, ' topic/p ')]">
<fo:block xsl:use-attribute-sets="p" id="{@id}">
<xsl:if test="not(contains(parent::*/@class,' topic/body '))">
<xsl:attribute name="space-after.optimum">0em</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</fo:block>
</xsl:template>
In human terms, if the parent topic is not a body element, or some specialization of it, set the space after to zero.
Hth,
Severin
Logged
dduffy
Member
Posts: 10
Re: Adjustment for <p> formatting when nested in other elements
«
Reply #2 on:
April 22, 2010, 07:30:45 AM »
Thanks Severin. That did it!
Logged
Pages:
1
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Forum Information
=> General XMetaL Discussion
=> DITA and XMetaL Discussion
=> XMetaL Tips and Tricks
=> XMetaL Announcements and Events
Loading...