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

Here should go questions about transforming XML with XSLT and FOP.
BobbyG66
Posts: 23

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

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: 221

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

Wed Nov 16, 2016 12:14 pm

Hello,

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

Regards,
Dan
BobbyG66
Posts: 23

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

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: 221

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

Fri Nov 18, 2016 12:27 pm

Please read the topic https://www.oxygenxml.com/forum/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>

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest