I’m trying to create a report in an email and email daemons chop lines if they’re over ~ 2040 characters long.
I’m using XSLT to build the email report and I need to break up these lines but I still need the link to work.
<xsl:variable name="encoded_url">
<xsl:value-of select="saxon:string-to-base64Binary(concat(PROTOCOL,'://',URL),'UTF8')" xmlns:saxon="http://saxon.sf.net/"/>
</xsl:variable>
<dd style="{$style-dd}">
<a title="View URL"
href="{$baseHref}report?url={$encoded_url}" style="{$style-links}">
<xsl:call-template name="break-url" >
<xsl:with-param name="url" select="URL" />
<xsl:with-param name="length">75</xsl:with-param>
<xsl:with-param name="lines">999</xsl:with-param>
</xsl:call-template>
</a>
This isn’t my code and I’m not real familiar with XSL but I’ve searched on here and on the web and I’m not really seeing an awesome solution.
This XPath 2.0 expression:
For test, this input:
With this XSLT 2.0 stylesheet:
Output:
Just in case, this XSLT 1.0 stylesheet: