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

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

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

Post by BobbyG66 » Tue Nov 15, 2016 11:54 pm

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: 453
Joined: Mon Feb 03, 2003 10:56 am

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

Post by Dan » Wed Nov 16, 2016 12:14 pm

Hello,

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

Regards,
Dan

BobbyG66
Posts: 33
Joined: Tue Oct 15, 2013 11:35 pm

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

Post by BobbyG66 » Wed Nov 16, 2016 3:06 pm

Thanks Dan,

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

BG66

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

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

Post by Dan » Fri Nov 18, 2016 12:27 pm

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