Reputation: 23
Hello any clue to align the title with the OPTION text without using table?
<xsl:choose>
<xsl:when test="@product='OPTION'">
<fo:block-container keep-together.within-line="always">
<fo:block>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
</fo:block>
<fo:block xsl:use-attribute-sets="title__option">
<xsl:text>OPTION </xsl:text>
<xsl:text> </xsl:text>
</fo:block>
</fo:block-container>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
</xsl:otherwise>
</xsl:choose>
Thanks, cheers
Upvotes: 1
Views: 1780
Reputation: 8068
It's not clear to me what you are trying to do, but you could:
fo:float
and float it to the sidefo:list-block
, etc., and use the "OPTION" fo:block
in the fo:list-item-label
fo:inline-container
for one or both blocksfo:leader
to keep the two pieces of text apartfo:change-bar-begin
(see https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#fo.change-bar-begin)Part of my confusion is that you have non-breaking spaces after the "OPTION" text.
Upvotes: 1
Reputation: 471
My sollution:
<fo:block>
<fo:inline-container inline-progression-dimension="49.9%">
<fo:block text-align="left">
content1
</fo:block>
</fo:inline-container>
<fo:inline-container inline-progression-dimension="49.9%">
<fo:block text-align="right">
content2
</fo:block>
</fo:inline-container>
</fo:block>
Upvotes: 1
Reputation: 23
Thanks for your answer.
I am actually trying to float right an OPTION "label" next to the title using the attributes sets for creating a background color on the OPTION text
3 ways failed:
List Block throws error: FOPException: Only non-null Positions with an index can be checked
<xsl:choose>
<xsl:when test="@product='OPTION'">
<fo:list-block>
<fo:list-item>
<fo:list-item-label>
<fo:block xsl:use-attribute-sets="title__option">
<xsl:text>OPTION </xsl:text>
</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
</xsl:otherwise>
</xsl:choose>
Float throws the error : [fop] [ERROR] No LayoutManager maker for class class org.apache.fop.fo.flow.Float and the OPTION text is not displayed
<xsl:choose>
<xsl:when test="@product='OPTION'">
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
<fo:float float="right">
<fo:block xsl:use-attribute-sets="title__option">
<xsl:text>OPTION </xsl:text>
</fo:block>
</fo:float>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
</xsl:otherwise>
</xsl:choose>
Inline-container throws no error but the paragraph is ignored and not displayed
<xsl:choose>
<xsl:when test="@product='OPTION'">
<fo:inline-container>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
<fo:block xsl:use-attribute-sets="title__option">
<xsl:text>OPTION </xsl:text>
</fo:block>
</fo:inline-container>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[contains(@class, ' topic/title ')]"/>
</xsl:otherwise>
</xsl:choose>
Upvotes: 0