AlexH: String zerlegen

Beitrag lesen

Edit: add choose

<!-- haupt template -->
<xsl:template name="explode">
<xsl:param name="text" />
<xsl:if test="string-length($text) > 0">
xsl:choose
   <xsl:when test="string-length(substring-before($text, '#')) > 0">
       <xsl:call-template name="output">
          <xsl:with-param name="message">
           <xsl:value-of select="substring-before($text, '#')" />
          </xsl:with-param>
       </xsl:call-template>
   </xsl:when>
   xsl:otherwise
       <xsl:call-template name="output">
          <xsl:with-param name="message">
            <xsl:value-of select="$text" />
          </xsl:with-param>
       </xsl:call-template>
  </xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>