Search code examples
xsl-foantenna-house

non breaking space in Antenna House


I'm not an expert, that's why asking for help. I have a problem with getting in the Antenna House preview - non breaking space (hard space). The XML document file contains non braking space (U+00A0). File is encoded in utf-8

Tried to add a parameter to the configuration file as below, but unfortunately it does not work (preview still shows normal spaces)

Antenna House ver. 6.4 Does anyone know how to configure Antenna House for the view to show hard spaces? I will be grateful for any help ;-)

<formatter-config>
<xslt-settings 
justify-nbsp="true"
  </xslt-settings>
</formatter-config>

enter image description here enter image description here


Solution

  • Firstly, even in AH Formatter V6.4, axf:justify-nbsp/justify-nbsp is an extension property, not a formatter option setting. I can't find anything about it ever being an option setting. As such, you just use it in your document/stylesheet just like any other inherited property (though you haven't said whether you're using XSL-FO or CSS).

    Secondly, AH Formatter does not have an option to make non-breaking spaces visible. You could, however, use XSLT to put an fo:inline/span around every non-breaking space and give that element a background color.


    Add axf:justify-nbsp="false" to your XSL-FO:

    <fo:block space-after="1em">podstawowa opieka zdrowotna lorem1 ipsum1 lorem2 ipsum2&#xA0;lorem3 ipsum3 fdg123b XXXX</fo:block>
    <fo:block axf:justify-nbsp="false">podstawowa opieka zdrowotna lorem1 ipsum1 lorem2 ipsum2&#xA0;lorem3 ipsum3 fdg123b XXXX</fo:block>
    

    With and without axf:justify-nbsp="false"

    Since axf:justify-nbsp is an inherited property (see hhttps://www.antenna.co.jp/AHF/help/en/ahf-ext.html#axf.justify-nbsp), if you want it to apply to the whole document, you could instead put it on the fo:root: i.e., <fo:root axf:justify-nbsp="false">.