About soft returns in content and export to Web

Build 1501 on 14/Nov/2017  This topic last edited on: 27/Sep/2016, at 12:29

If you use soft returns in headlines and sub-headlines, it may happen that they get exported to Web without spaces or breaks between the words. Viewing article xml from edo.ashx you can see the <br /> does appear in the xml but does not translate to spaces.

For example the headline below should be Web Test soft Returns:

Click to toggle graphic size

A possible solution is to map the headline style in the Output XML instead as <headline>#T</headline> to <p>#T</p>:

Click to toggle graphic size

 

Then, change your the xsl_tognweb on the br template;

<xsl:template match="br">

 <xsl:choose>

 <xsl:when test="parent::head or parent::p or parent::headline">

         <xsl:text>&#160;</xsl:text>

 </xsl:when>

 <xsl:otherwise>

         <xsl:element name="br" />

 </xsl:otherwise>

         </xsl:choose>

</xsl:template>

to obtain the article Xml as

(http://localhost/i4/edo.ashx?cmd=articleXml&id=25100&Typography=Default)

Click to toggle graphic size

and with the xsl changes, the <br> will be replaced with a space:

(http://localhost/i4/do.ashx?cmd=feed&name=gnweb&ids=25100&pars=region:Globe:Print;defaultFormat:J;remCodes:1)

Click to toggle graphic size

For this to work, you need to use apply-templates to apply the "br" template and not to use the value-of-select:

Click to toggle graphic size