1

I would like to use the attribute hyphenate="true" on my tag <subtitle>, and set hyphenation="false" on the <italic> elements it may contain. The problem is that I can use the hyphenation only on fo:block and fo:character. Could someone give me an advice?

This is an example of my xml:

<subtitle type="subtitles">
    Some text that should have the hyphenation true 
    (<italic>This one shoud have the hyphenation false</italic>).
</subtitle>
Pocho
  • 51
  • 3
  • 12
  • Can you use XSLT 2.0? What is the content model for `italic` (only text or other elements too)? – lfurini Jan 12 '18 at 18:45
  • Inside I have only text. Now I can't use XSLT 2.0, because there are a lot of document, but if it's the only manner I have to do it; do you have an idea ? – Pocho Jan 12 '18 at 20:33

1 Answers1

2

hyphenate is an inherited property (see https://www.w3.org/TR/xsl11/#hyphenate). The text in your XSL-FO is treated as if it was a sequence of fo:character FOs (see https://www.w3.org/TR/xsl11/#fo_character).

Just put hyphenate="false" on the fo:inline for italic and it will have effect on the notional fo:character FOs making up the text.

Tony Graham
  • 7,306
  • 13
  • 20
  • And remove keep-together="always" because in a conforming processor, this would have the effect of keeping everything inside the italic element together on a single line. – Kevin Brown Jan 12 '18 at 22:56
  • @Tony Graham Hi, thank you, I have already tried your advise, but doesn't run, because the hyphenation work only on fo:block and fo:character. Kevin Brown Hi Kevin, yes I tried everything like that, but doesn't run for instance keep-with-previous etc... – Pocho Jan 13 '18 at 08:06
  • I will test BUT you are using FOP. If something that should be supported is not, then report it to them. If you would like to even attempt alternative "hacks" to make it behave, good luck. You could try something like splitting every word in the italic grouplng into an inline that has keep-together.within-line = "always" ... up to you. – Kevin Brown Jan 14 '18 at 05:57