Home Forums DITA and XMetaL Discussion Wrapping in Tables Reply To: Wrapping in Tables

Derek Read

Reply to: Wrapping in Tables

By default the output is designed to shrink the word and letter spacing so that a sentence or word fits on a line. In this case as your URL is considered a “word” (no spaces) it cannot be broken to line wrap and the entire thing is gets negative “kerning” applied to the point where in some cases letter may overlap making it unreadable.

There will be many different solutions for this, but one that I have decided seems to be best is to insert a ZERO WIDTH SPACE (U+200B) after certain characters within certain elements. This gives RenderX XEP the opportunity to break on these characters when necessary (and that take precedence over its text shrinking logic).

In your specific case you can try something like the following. In this case I had a client that often had very long URLs included with other code inside so I was able to modify that specific template. If your long URLs are in some other element(s) then you will need to modify that/those instead. I'm not sure how easy it would be to make this universal but that might be worth looking into as well. Note that the other trick to this is that I always replace the specific character “/”.

The following code change will work under these conditions:

1. You generate output using the deliverable named “XMetaL Enhanced PDF via RenderX XEP”.
2. Your URL (or whatever your long text string is) contains the character “/” at regular intervals, with each chunk divided by it being short enough to fit within the containing space. This is easily modified if you want to break at other characters instead (see code).
3. Your URL is contained within the element . This is easily modified but you will need the name of the template used for your element. A cross file text search tool (I use Notepad++ to write my XSLT). You may need to make modifications to more than one template in some cases.

File to change:
%appdata%SoftQuadXMetaL SharedDITA_OTdemoxmfoCustomizationfoxslcustom.xsl

If you will be distributing this to other users it would be best to modify the following file instead and then [url=http://forums.xmetal.com/index.php/topic,1008.msg3257.html#msg3257]redeploy[/url] the DITA OT:
C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoCustomizationfoxslcustom.xsl

   exclude-result-prefixes=”opentopic exslf opentopic-func”





Remember that you need to duplicate the existing template entirely (as done here) in order to retain anything it was doing before (because an override template entirely replaces the original, it does not extend it). I usually duplicate a template right inside the file it is inside first, then make mods to the duplicate copy while testing. Then once it is working I move everything into the custom.xsl to keep things neat and tidy. Note as well that I comment where any templates I am overriding are by including a reference to the filename. This way, in future versions of the DITA OT specifically, you can find those files and check to see if you need to update your modified version.