Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

275 linhas
8.6 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE xsl:stylesheet [
  3. <!ENTITY nbsp "&#160;">
  4. <!ENTITY br "&#10;">
  5. <!ENTITY dot "&#149;">
  6. <!ENTITY raquote "&#187;">
  7. <!ENTITY lsbracket "&#91;">
  8. <!ENTITY Auml "&#196;">
  9. <!ENTITY Ouml "&#214;">
  10. <!ENTITY Uuml "&#220;">
  11. <!ENTITY auml "&#228;">
  12. <!ENTITY ouml "&#246;">
  13. <!ENTITY uuml "&#252;">
  14. ]>
  15. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  16. <xsl:output method="text" encoding="ISO-8859-1"/>
  17. <xsl:template match="ihknewsletter">
  18. <xsl:call-template name="targets"/>
  19. <xsl:call-template name="browserlink"/>
  20. <xsl:call-template name="salutation"/>
  21. <xsl:for-each select="news">
  22. <xsl:call-template name="news"/>
  23. </xsl:for-each>
  24. <xsl:apply-templates select="imprint"/>
  25. <xsl:apply-templates select="footer"/>
  26. </xsl:template>
  27. <xsl:template name="targets">
  28. <xsl:text>[%if </xsl:text>
  29. <xsl:for-each select="news">
  30. <xsl:if test="position()!=1">
  31. <xsl:text> AND </xsl:text>
  32. </xsl:if>
  33. <xsl:choose>
  34. <xsl:when test="target">
  35. <xsl:for-each select="target">
  36. <xsl:if test="position()!=1">
  37. <xsl:text> AND </xsl:text>
  38. </xsl:if>
  39. <xsl:choose>
  40. <xsl:when test="string-length(.)&gt;0">
  41. <xsl:text>BelongsNotToGroup("</xsl:text><xsl:value-of disable-output-escaping="yes" select="."/><xsl:text>")</xsl:text>
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <xsl:text> FALSE </xsl:text>
  45. </xsl:otherwise>
  46. </xsl:choose>
  47. </xsl:for-each>
  48. </xsl:when>
  49. <xsl:otherwise>
  50. <xsl:text> FALSE </xsl:text>
  51. </xsl:otherwise>
  52. </xsl:choose>
  53. </xsl:for-each>
  54. <xsl:text>] [%no-mail] </xsl:text>
  55. <xsl:text> [%endif] </xsl:text>
  56. </xsl:template>
  57. <xsl:template name="browserlink">
  58. <xsl:text>M&ouml;chten Sie diesen Newsletter mit Bildern betrachten? Zur Webseitenansicht&br;</xsl:text>
  59. <xsl:text>[%application-url]/html_mail.jsp?params=[%online_params]&br;</xsl:text>
  60. </xsl:template>
  61. <xsl:template name="salutation">
  62. <xsl:text>[%hr(=)]&br;</xsl:text>
  63. <xsl:value-of select="salutation/address"/>
  64. <xsl:text>&br;&br;</xsl:text>
  65. <xsl:for-each select="salutation/paragraph">
  66. <xsl:choose>
  67. <xsl:when test="position()=last()">
  68. <xsl:value-of select="."/>
  69. <xsl:text>&br;</xsl:text>
  70. </xsl:when>
  71. <xsl:otherwise>
  72. <xsl:value-of select="."/>
  73. <xsl:text>&br;&br;</xsl:text>
  74. </xsl:otherwise>
  75. </xsl:choose>
  76. </xsl:for-each>
  77. <xsl:text>&br;</xsl:text>
  78. <xsl:value-of select="salutation/greeting"/>
  79. <xsl:text>&br;</xsl:text>
  80. <xsl:value-of select="salutation/sig_name"/>
  81. <xsl:text>&br;&br;</xsl:text>
  82. <xsl:text>Abonnement &auml;ndern? </xsl:text>
  83. <xsl:text>[%application-url]/benutzerprofil.jsp?email=[email]&amp;id=[%id]</xsl:text>
  84. <xsl:text>&br;&br;</xsl:text>
  85. </xsl:template>
  86. <xsl:template name="news">
  87. <xsl:if test="target">
  88. <xsl:call-template name="start_target"/>
  89. </xsl:if>
  90. <xsl:variable name="feld">
  91. <xsl:choose>
  92. <xsl:when test="string-length(//ihknewsletter/all_gesch_feld/gesch_feld) > 0">
  93. <xsl:value-of select="//ihknewsletter/all_gesch_feld/gesch_feld"/>
  94. </xsl:when>
  95. <xsl:otherwise>
  96. <xsl:value-of select="news_gesch_feld"/>
  97. </xsl:otherwise>
  98. </xsl:choose>
  99. </xsl:variable>
  100. <xsl:variable name="underline_len">
  101. <xsl:if test="string-length(title) >= 75">75</xsl:if>
  102. <xsl:if test="string-length(title) &lt; 75"><xsl:value-of select="string-length(title)"/></xsl:if>
  103. </xsl:variable>
  104. <xsl:text>&br;&br;</xsl:text>
  105. <xsl:if test="title_show = 'ja'">
  106. <xsl:if test="string-length($feld) > 0">
  107. <xsl:text>&br;</xsl:text>
  108. <xsl:value-of select="$feld"/>
  109. <xsl:text>[%hr(=)] &br;</xsl:text>
  110. </xsl:if>
  111. </xsl:if>
  112. <xsl:value-of select="title"/>
  113. <xsl:text>&br;</xsl:text>
  114. <xsl:call-template name="underline">
  115. <xsl:with-param name="count" select="$underline_len"/>
  116. </xsl:call-template>
  117. <xsl:text>&br;</xsl:text>
  118. <xsl:for-each select="paragraph">
  119. <xsl:choose>
  120. <xsl:when test="position()=last()">
  121. <xsl:if test="string-length(.) > 0">
  122. <xsl:value-of select="."/>
  123. <xsl:text>&br;</xsl:text>
  124. </xsl:if>
  125. </xsl:when>
  126. <xsl:otherwise>
  127. <xsl:if test="string-length(.) > 0">
  128. <xsl:value-of select="."/>
  129. <xsl:text>&br;&br;</xsl:text>
  130. </xsl:if>
  131. </xsl:otherwise>
  132. </xsl:choose>
  133. </xsl:for-each>
  134. <xsl:if test="link">
  135. <xsl:value-of disable-output-escaping="yes" select="link"/>
  136. <xsl:text>&br;</xsl:text>
  137. </xsl:if>
  138. <xsl:if test="target">
  139. <xsl:call-template name="end_target"/>
  140. </xsl:if>
  141. </xsl:template>
  142. <xsl:template match="imprint">
  143. <xsl:text>&br;[%hr(=)] &br;&br;</xsl:text>
  144. <xsl:text>Impressum&br;</xsl:text>
  145. <xsl:call-template name="underline">
  146. <xsl:with-param name="count" select="string-length('Impressum')"/>
  147. </xsl:call-template>
  148. <xsl:text>&br;</xsl:text>
  149. <xsl:value-of select="name"/>
  150. <xsl:text>&br;</xsl:text>
  151. <xsl:value-of select="street"/>
  152. <xsl:text>&br;</xsl:text>
  153. <xsl:value-of select="city"/>
  154. <xsl:text>&br;&br;</xsl:text>
  155. <xsl:text>Telefon: </xsl:text>
  156. <xsl:value-of select="phone"/>
  157. <xsl:text>&br;</xsl:text>
  158. <xsl:if test="fax">
  159. <xsl:text>Telefax: </xsl:text>
  160. <xsl:value-of select="fax"/>
  161. <xsl:text>&br;</xsl:text>
  162. </xsl:if>
  163. <xsl:if test="website">
  164. <xsl:text>Website: </xsl:text>
  165. <xsl:value-of select="website"/>
  166. <xsl:text>&br;</xsl:text>
  167. </xsl:if>
  168. <xsl:text>E-Mail: </xsl:text>
  169. <xsl:value-of select="email"/>
  170. <xsl:text>&br;&br;</xsl:text>
  171. <xsl:if test="ceo">
  172. <xsl:text>Gesch&auml;ftsf&uuml;hrer: </xsl:text>
  173. <xsl:value-of select="ceo"/>
  174. <xsl:text>&br;</xsl:text>
  175. </xsl:if>
  176. <xsl:if test="editorial_office">
  177. <xsl:text>Redaktion: </xsl:text>
  178. <xsl:value-of select="editorial_office"/>
  179. <xsl:text>&br;</xsl:text>
  180. </xsl:if>
  181. <xsl:if test="register">
  182. <xsl:text>Register: </xsl:text>
  183. <xsl:value-of select="register"/>
  184. <xsl:text>&br;</xsl:text>
  185. </xsl:if>
  186. <xsl:if test="tax">
  187. <xsl:text>Umsatzsteuer-ID: </xsl:text>
  188. <xsl:value-of select="tax"/>
  189. <xsl:text>&br;</xsl:text>
  190. </xsl:if>
  191. </xsl:template>
  192. <xsl:template match="footer">
  193. <xsl:text>&br;</xsl:text>
  194. <xsl:for-each select="paragraph">
  195. <xsl:value-of select="."/>
  196. <xsl:text>&br;&br;</xsl:text>
  197. </xsl:for-each>
  198. <xsl:text>Newsletter-Abonnement beenden? </xsl:text>
  199. <xsl:value-of disable-output-escaping="yes" select="unsubscribe"/>
  200. <xsl:text>&br;&br;</xsl:text>
  201. <xsl:if test="string-length(copyright)&gt;0">
  202. <xsl:text/>
  203. <xsl:value-of select="copyright"/>
  204. <xsl:text>&br;[%hr(=)]</xsl:text>
  205. </xsl:if>
  206. </xsl:template>
  207. <xsl:template name="underline" xml:space="default">
  208. <xsl:param name="count"/>
  209. <xsl:if test="number($count) > 0">-<xsl:call-template name="underline">
  210. <xsl:with-param name="count" select="number($count) - 1"/>
  211. </xsl:call-template>
  212. </xsl:if>
  213. </xsl:template>
  214. <xsl:template name="start_target">
  215. <xsl:variable name="ending">
  216. <xsl:for-each select="target">
  217. <xsl:sort select="." data-type="text" order="descending" />
  218. <xsl:if test="position()=1">
  219. <xsl:if test="string-length(.) > 0">]
  220. </xsl:if>
  221. </xsl:if>
  222. </xsl:for-each>
  223. </xsl:variable>
  224. <xsl:for-each select="target">
  225. <xsl:sort select="." data-type="text" order="descending" />
  226. <xsl:if test="string-length(.) > 0">
  227. <xsl:if test="position() = 1">
  228. <xsl:text>
  229. [%if </xsl:text>
  230. </xsl:if>
  231. <xsl:if test="position() != 1">
  232. <xsl:text> OR </xsl:text>
  233. </xsl:if>
  234. <xsl:text>BelongsToGroup("</xsl:text><xsl:value-of disable-output-escaping="yes" select="."/><xsl:text>")</xsl:text>
  235. </xsl:if>
  236. <xsl:if test="position()=last()">
  237. <xsl:value-of select="$ending"/>
  238. </xsl:if>
  239. </xsl:for-each>
  240. </xsl:template>
  241. <xsl:template name="end_target">
  242. <xsl:for-each select="target">
  243. <xsl:sort select="." data-type="text" order="descending" />
  244. <xsl:if test="string-length(.) > 0">
  245. <xsl:if test="position() = 1">
  246. <xsl:text>
  247. [%endif]
  248. </xsl:text>
  249. </xsl:if>
  250. </xsl:if>
  251. </xsl:for-each>
  252. </xsl:template>
  253. </xsl:stylesheet>