[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Selectively displaying numbers

Subject: Selectively displaying numbers
From: Mick <mick@xxxxxxxxxxxx>
Date: Tue, 29 Aug 2000 11:27:29 +0200
displaying numbers
I have the following problem. In an xml file I have marked up lines, using
an attribute for line numbers, e.g.:

<line lineID="1">this is the first line</line>
<line lineID="2">this is the second line</line>
<line lineID="3">and so on, and so forth</line>

I'm using the following xsl to display the lines and their line numbers:

<td><xsl:value-of select="@lineID"/></td> <td><xsl:value-of
select="."/></td>

With this, each line is numbered. What I would like is to number ever 5th
line, so I only get line numbers for 5, 10, 15, 20 etc.

I've worked out what the xsl should be, but my knowledge of xsl-maths is
failing me. In simple prose, I would like the following. If the result of
"@lineID divided by 5" is a round number (i.e. no decimals, fractions) then
display the line number; else do not display.
In other words:

If (@lineID/5)=round number -> <td><xsl:value-of select="@lineID"/>
Else -> <td></td>

Can anyone help me and tell me what the xsl should be? Much appreciated.

Mick
mick@xxxxxxxxxxxx


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.