This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Counting non-empty elements


Try

<xsl:if test="string(itemDesc)">

-kevin

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of Sergej
Sent: Wednesday, March 13, 2002 9:07 AM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] Counting non-empty elements


Hello everybody,

sorry but I am a novice in this field and probably my question has an
easy 
solution, but I cannot find it.
I'd like to write a number near non-empty descriptions as shown in the 
following code:
         <xsl:template match="itemSet">
                         <tr>
                                 <td>
                                         <xsl:if 
test="normalize-space(itemDesc)">
                                                 <xsl:number 
level="multiple" format="1. "/>
                                                 <xsl:value-of 
select="itemDesc"/>
                                         </xsl:if>
                                 </td>
                                 <td>
                                 ....
                                 </td>
                         </tr>
                         ....
         </xsl:template>

The problem is that also the empty elements are taken into account even
if 
the number does not appear. In other words I get something like

1. Description 1        xxxx
                         xxxx
3. Description 3        xxxx
                         xxxx
5. Description 4        xxxx

and I'd like '3.' to be '2.' and '5.' to be '3.'

Does anybody know how should I do. Thanx a lot for your help.

Sergej



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]