WebTeckie
14/12/02, 14:36
On Sun, 08 Dec 2002 19:44:47 +0100, Pieter Van Isacker <pierrevi@nospamyucom.be>
wrote:
>> <td nowrap="nowrap" style="font-size: smaller; font-family: monospace">
>> <xsl:choose>
>> <xsl:when test="string-length(./Length) < 3">
>> <xsl:value-of select="concat('0.', ./Length, 's')" />
>> </xsl:when>
>> <xsl:otherwise>
>> <xsl:variable name="ms_separator_pos"
>> select="string-length(./Length) - 2" />
>> <xsl:value-of select="concat(substring(./Length, 0,
>> $ms_separator_pos), '.', substring(./Length, $ms_separator_pos), 's')" />
>> </xsl:otherwise>
>> </xsl:choose>
>> </td>
>
>Kan je mij eens uitleggen wat hier juist gebeurt? Hoe het werkt?
Sorry voor de late respons. Ik heb eigenlijk alleen 's weekends tijd voor news
:)
Ik maak een variabele aan, om de positie "laatste 3" in te gooien:
ms_separator_pos
Daarna gebruik ik de 'substring' functie, om de twee delen te splitsen in
seconden en milliseconden. De concat function, plakt strings aan elkaar.
Ik gebruik <xsl:choose> (if met else) om te kijken of de tijd ook langer is dan
3. Dan is het namelijk allemaal niet nodig :)
--
WebTeckie
Programming is like art: it only looks like chaos.
wrote:
>> <td nowrap="nowrap" style="font-size: smaller; font-family: monospace">
>> <xsl:choose>
>> <xsl:when test="string-length(./Length) < 3">
>> <xsl:value-of select="concat('0.', ./Length, 's')" />
>> </xsl:when>
>> <xsl:otherwise>
>> <xsl:variable name="ms_separator_pos"
>> select="string-length(./Length) - 2" />
>> <xsl:value-of select="concat(substring(./Length, 0,
>> $ms_separator_pos), '.', substring(./Length, $ms_separator_pos), 's')" />
>> </xsl:otherwise>
>> </xsl:choose>
>> </td>
>
>Kan je mij eens uitleggen wat hier juist gebeurt? Hoe het werkt?
Sorry voor de late respons. Ik heb eigenlijk alleen 's weekends tijd voor news
:)
Ik maak een variabele aan, om de positie "laatste 3" in te gooien:
ms_separator_pos
Daarna gebruik ik de 'substring' functie, om de twee delen te splitsen in
seconden en milliseconden. De concat function, plakt strings aan elkaar.
Ik gebruik <xsl:choose> (if met else) om te kijken of de tijd ook langer is dan
3. Dan is het namelijk allemaal niet nodig :)
--
WebTeckie
Programming is like art: it only looks like chaos.