Re: [xsl] conditional multiline output

Subject: Re: [xsl] conditional multiline output
From: Owen Rees <owen.rees@xxxxxx>
Date: Tue, 06 Feb 2007 10:21:04 +0000
--On Tuesday, February 06, 2007 10:44:30 +0100 Erwin Kloeck wrote:

Where
does the space in front of the closing bracket come from and how do I
get rid of it?

                    <xsl:value-of
select="concat(current-group()[$i]/@string, ' [',
current-group()[$i]/@count), ']'" />

The ']' is outside the concat so the select is a sequence of two strings and the default space separator is inserted. Fix this by moving the ) that closes the concat to after the ']'.


You should also change this:

       <xsl:variable name="max-count" >
           <xsl:value-of select="max(for $date in $dates return
count(date[@value = $date]))" />
       </xsl:variable>

to

<xsl:variable name="max-count" select="max(for $date in $dates return
count(date[@value = $date]))" />


Using value-of causes max-count to be a string which is not what you want.

--
Owen Rees
Hewlett Packard Laboratories, Bristol, UK

Current Thread