Another "Is this expected behaviour?"

CSS XPP 9.4.1

I have an interesting issue - the XML I have been supplied with has "xxx</close><open>Zzz". The requirement (apart from changing typeface etc) is to add a period and a space so I end up with:

xxx</close>. <open>Zzz

I am generating the period and space in the close::after pseudo-element selector and most of the time it is working perfectly. However if the last word before the </close> is a very long word (and its in 2 columns to a short measure) then the last word will not hyphenate. If I only generate the period and add space manually, either before or after the <open> element then the long word hyphenates perfectly and as expected. However is does act as you would expect if the justification means finishing a line! Interestingly if I remove the space altogether the word xxx.Zzz will hyphenate.

One option would be to transform and add the space but I am very nervous about that is this could cause issues if the XML is inconsistent.

Interested to hear if anyone else has encountered a similar issue.

Chris

Parents Reply Children
  • A space always ends a word, but when you have the space as generated text then the word ends in generated text (and thus hits the limitation where that word ending with that generated space will not hyphenate).

    If you take the space out, then the "word" continues until the next space (the period itself does not end a word), and so now the "word" as far as composition is concerned no longer ends in generated text and so composition will be able to "hyphenate" (or break) the "word" (which is now actually two words separated by a period) - depending on the H&J settings - and most likely the limitation will not allow a break at the generated space itself.

    You mentioned "changing typeface etc.". Is there anything after the space in what you are generating (such as other macros)? If so, can you try moving those to before the space so that the very last thing in the generated text is the space?

    That may not be enough to avoid the limitation, but might be worth a try if the space is not absolutely last.

    Jonathan Dagresta

    SDL XPP Engineering

    Jonathan Dagresta
    RWS Group/
    XPP Development

  • It looks like I am going to have a lot of work to do and use the solution Bart has suggested below - adding a PI direct into the data that calls a macro that adds a space (rather than "generates" a space). It is going to mean lots of transform rules and changes to the CSS but it does explain some of the many issues I was having with pagination. Thanks for the explanation even if it is not what I really wanted to hear!