There are multitude ways of reading of the question. It is absolutely unclear. Can you pose the question again? Line break, where to appear? in the xsl document? in the resultant document of the transformation? ...
Well here's an abridged version of my document, the goal is to get a line break after the ... first line.
<xsl:template name="iGetOptOutInstructions" match="/">
This is the text that should appear on the first line.
And this text should appear on the second line
</xsl:template>
Below is the header of my document:
<?xml version="1.0" encoding="UTF-8"?>
<!-- returns footer for email notification which explains where the notification originated and how to opt out -->
[1] From the outline shown, I would say, take out the match attribute in the named template. And a <br /> should serve the bill? And since, it is not clear the surrounding where the name templated is called, I put a further div tag to wrap it. You can further style it as needed.
[tt]
<xsl:template name="iGetOptOutInstructions">
<div>
This is the text that should appear on the first line.
<br />
And this text should appear on the second line
</div>
</xsl:template>
[/tt]
[1.1] The whitespaces would be collapsed in the html page. Hence, I think it should do no matter how much space and line break appear in xsl document?
[2] Often, wrapping it with a <pre> tag may help at the first instance to get the general picture before elaborate it with br or div etc.
Thank you very much for your help! I have implemented the changes however the resulting email unfortunately didn't recognise the breaks. I will paste the entire document below; the changes I have made are near the bottom.
Many thanks:
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!-- returns footer for email notification which explains where the notification originated and how to opt out -->
<xsl:template name="GetVendorNotificationFooter" match="/">
<xsl:call-template name="iGetFooter">
<xsl:with-param name="strOptOutInstructions"><BR />Wenn Sie keine weiteren Benachrichtigungs-E-Mails dieser Art erhalten möchten, setzen Sie sich bitte mit dem Drucker in Verbindung, und lassen Sie sich aus der Verteilerliste austragen.</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="iGetFooter" match="/">
<xslaram name="strOptOutInstructions" />
<TABLE WIDTH="50%">
<TR>
<TD ALIGN="LEFT" VALIGN="BOTTOM">
<SPAN CLASS="baseSansBoldBlue">
Info zu dieser E-Mail
</SPAN>
<HR WIDTH="100%" />
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="BOTTOM">
<SPAN CLASS="baseSans">
Diese E-Mail wurde automatisch von InSite generiert: <A HREF="{ //Notification/ServerURL }"> <xsl:value-of select="//Notification/ServerURL" /></A>
<BR />
<xsl:value-of select="$strOptOutInstructions" />
</SPAN>
</TD>
</TR>
</TABLE>
</xsl:template>
<xsl:template name="iGetOptOutInstructions" match="/">
Wenn Sie keine weiteren E-Mail-Benachrichtigungen dieser Art erhalten möchten, melden Sie sich bitte bei InSite an, bearbeiten Sie Ihr Benutzerprofil, und wählen Sie die Option 'Alle E-Mail-Benachrichtigungen deaktivieren' aus.
</xsl:template>
<xsl:template name="iGetSubscriberOptOutInstructions">
<div>
Wenn Sie keine weiteren E-Mail-Benachrichtigungen dieser Art erhalten möchten, melden Sie sich bitte bei InSite an, bearbeiten Sie Ihr Benutzerprofil, und ändern Sie die abonnierten E-Mail-Ereignisse entsprechend.
<br />
My Comapny
<br />
My Road
<br />
My ZIP Code
<br />
My country
</div>
</xsl:template>
[3] As I mentioned, named template may have match attribute. But, it would subject to the same competition/priority rule when there are conflicts of match. In your xsl document, there are "ton" of templates (named) that match document root (/). That mean, more or less, the last would win out.
[4] This is an attempt to rectify all the conflicts, see if it does something positive in your cause.
[tt]
<?xml version="1.0" encoding="UTF-8"?>
<!-- returns footer for email notification which explains where the notification originated and how to opt out -->
<xsl:template name="GetVendorNotificationFooter[highlight]">[/highlight]
<xsl:call-template name="iGetFooter">
<xsl:with-param name="strOptOutInstructions"><BR />Wenn Sie keine weiteren Benachrichtigungs-E-Mails dieser Art erhalten möchten, setzen Sie sich bitte mit dem Drucker in Verbindung, und lassen Sie sich aus der Verteilerliste austragen.</xsl:with-param>
</xsl:call-template>
</xsl:template>
<TABLE WIDTH="50%">
<TR>
<TD ALIGN="LEFT" VALIGN="BOTTOM">
<SPAN CLASS="baseSansBoldBlue">
Info zu dieser E-Mail
</SPAN>
<HR WIDTH="100%" />
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="BOTTOM">
<SPAN CLASS="baseSans">
Diese E-Mail wurde automatisch von InSite generiert: <A HREF="{ //Notification/ServerURL }"> <xsl:value-of select="//Notification/ServerURL" /></A>
<BR />
<xsl:value-of select="$strOptOutInstructions" />
</SPAN>
</TD>
</TR>
</TABLE>
</xsl:template>
<xsl:template name="iGetOptOutInstructions[highlight]">[/highlight]
Wenn Sie keine weiteren E-Mail-Benachrichtigungen dieser Art erhalten möchten, melden Sie sich bitte bei InSite an, bearbeiten Sie Ihr Benutzerprofil, und wählen Sie die Option 'Alle E-Mail-Benachrichtigungen deaktivieren' aus.
</xsl:template>
<xsl:template name="iGetSubscriberOptOutInstructions">
<div>
Wenn Sie keine weiteren E-Mail-Benachrichtigungen dieser Art erhalten möchten, melden Sie sich bitte bei InSite an, bearbeiten Sie Ihr Benutzerprofil, und ändern Sie die abonnierten E-Mail-Ereignisse entsprechend.
<br />
My Comapny
<br />
My Road
<br />
My ZIP Code
<br />
My country
</div>
</xsl:template>
[4.1] Upon reading some of your named template, you've implemented br etc in iGetSubscriberOptOutInstructions rather than, perhaps your original, iGetOptOutInstructions. Hence, you've to change also this line.
[tt]
<xsl:template name="GetFooter">
<xsl:call-template name="iGetFooter">
<xsl:with-param name="strOptOutInstructions"><xsl:call-template name="iGet[red]Subsriber[/red]OptOutInstructions" /></xsl:with-param>
</xsl:call-template>
</xsl:template>
[/tt]
[5] This is a clean up version that I think illustrate the working. I have to eliminate quite a bit of unused lines to make the logic clearer. But the main thing of the clean up is to rectify some chaining of template call resulting in the lost of tagging proper. (I won't highlight the modifications, as it is that numerous.) I keep a parameter passing so that it stands ready to be extended with different value to be passed, rather than unidimensionally "iGetSubscriberOptOutInstructions".
[tt]
<?xml version="1.0" encoding="UTF-8"?>
<!-- returns footer for email notification which explains where the notification originated and how to opt out -->
<xsl:stylesheet xmlns:xsl="[ignore]
[/ignore]" version="1.0" xml:space="preserve">
<xslutput method="html" />
<xsl:template match="/">
<html><body>
<!-- call other named templates as needed -->
<xsl:call-template name="GetFooter" />
<!-- call other named templated as needed -->
</body></html>
</xsl:template>
<xsl:template name="iGetFooter">
<xslaram name="strOptOutInstructions" />
<TABLE WIDTH="50%">
<TR>
<TD ALIGN="LEFT" VALIGN="BOTTOM">
<SPAN CLASS="baseSansBoldBlue">
Info zu dieser E-Mail
</SPAN>
<HR WIDTH="100%" />
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="BOTTOM">
<SPAN CLASS="baseSans">
Diese E-Mail wurde automatisch von InSite generiert: <A HREF="{ //Notification/ServerURL }"> <xsl:value-of select="//Notification/ServerURL" /></A>
<BR />
<xsl:if test="$strOptOutInstructions='iGetSubscriberOptOutInstructions'">
<xsl:call-template name="iGetSubscriberOptOutInstructions" />
</xsl:if>
</SPAN>
</TD>
</TR>
</TABLE>
</xsl:template>
<xsl:template name="iGetSubscriberOptOutInstructions">
<div>
Wenn Sie keine weiteren E-Mail-Benachrichtigungen dieser Art erhalten möchten, melden Sie sich bitte bei InSite an, bearbeiten Sie Ihr Benutzerprofil, und ändern Sie die abonnierten E-Mail-Ereignisse entsprechend.
<br />
My Comapny
<br />
My Road
<br />
My ZIP Code
<br />
My country
</div>
</xsl:template>
</xsl:stylesheet>
[/tt]
[5.1] This can serve as a base so that you can see the result expected and that you can elaborate further.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.