Keep <title> and <image> together in <fig> element

Here should go questions about transforming XML with XSLT and FOP.
BobbyG66
Posts: 37
Joined: Tue Oct 15, 2013 11:35 pm

Keep <title> and <image> together in <fig> element

Post by BobbyG66 »

I have a Concept with a large number of images with titles.
When these break on the pages, the titles are widowed and the images orphaned.
Have tried a number of ways to "keep-with-next" type options in the

Code: Select all

plugin/cfg/fo/attrs/commons-attr.xsl
file.
The issue I see is that the <title> and <image> attribute are separate in the <fig> tag.
Any ideas?
Here is the code layout:
[Codebox=]<fig>
<title>Title</title>
<image href="/Content/Label.png">
</fig>[/Codebox]

Thanks
BG66
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Keep <title> and <image> together in <fig> element

Post by Dan »

Hello,

Try using: page-break-inside="avoid" on the fig element.

Regards,
Dan
BobbyG66
Posts: 37
Joined: Tue Oct 15, 2013 11:35 pm

Re: Keep <title> and <image> together in <fig> element

Post by BobbyG66 »

Thanks Dan,

Was not aware of that attribute.
I tried that and it didn't work.

BG66
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Re: Keep <title> and <image> together in <fig> element

Post by Dan »

Please read the topic topic12552.html, it is the same problem, but it refers to tables.
I think you could use:

Code: Select all


<xsl:attribute-set name="fig" .......... >
<xsl:attribute name="keep-together.within-page">1</xsl:attribute>
</xsl:attribute-set>
Post Reply