473,382 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

xsl for each for every 5 element

I have below xml document with Kbase element,i doing paging.
paging part is done. Now I need to linking.
I am displaying 5 elements for each page
so How do i write a for loop that displays for the amount of elements
below and writes
1 2 3

i wrote below and no go

<xsl:for-each select="//Kbase">
<xsl:if test="position() &gt; ($Page * $PageSize) + 1">
<xsl:if test="position() &lt; $PageSize + ($PageSize * $Page)">
<a href="javascript:changePage(5);">
<xsl:value-of select="position()"/>
</a>
</xsl:if>
</xsl:if>
</xsl:for-each>

<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
<Kbase id="KB709966"/>
Jul 20 '05 #1
2 1971

"metehan" <me*******@Hotmail.com> wrote in message
news:ea**************************@posting.google.c om...
I have below xml document with Kbase element,i doing paging.
paging part is done. Now I need to linking.
I am displaying 5 elements for each page
so How do i write a for loop that displays for the amount of elements
below and writes
1 2 3

Look in the xsl faq about producing a table with N number of columns.

Or here:
http://www.topxml.com/code/default.a...20020514091249

Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
Jul 20 '05 #2
I get around it
here is the script
<xsl:template match="rowset">
<xsl:for-each select="row[position() mod 5 = 1]">
<xsl:number/><br/>
<!--<xsl:apply-templates select=". |
following-sibling::row[position() &lt; 5]" /><br/>-->

</xsl:for-each>
</xsl:template>
"Dimitre Novatchev [MVP XML]" <dn********@yahoo.com> wrote in message news:<c0*************@ID-152440.news.uni-berlin.de>...
"metehan" <me*******@Hotmail.com> wrote in message
news:ea**************************@posting.google.c om...
I have below xml document with Kbase element,i doing paging.
paging part is done. Now I need to linking.
I am displaying 5 elements for each page
so How do i write a for loop that displays for the amount of elements
below and writes
1 2 3

Look in the xsl faq about producing a table with N number of columns.

Or here:
http://www.topxml.com/code/default.a...20020514091249

Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Mark Constant | last post by:
I have a xslt file and it keeps giving me an EOF error when it reaches the point <xsl:for-each select="lc:Entertainment/lc:$Hardware"> and <xsl:for-each select="lc:Entertainment/lc:$Hardware"> ...
80
by: | last post by:
Is there a performance difference between this: \\\ Dim i As Integer For i = 0 to myObject.Controls.Count - 1 myObject.Controls(i) = ... Next /// and this:
2
by: Tarren | last post by:
Hi: The problem I am having is when I validate an xml file to a schema, it is erroring out every element. I think this has something to do with me defining/referencing the namespaces. I have...
2
by: Renjini | last post by:
hi everyone, i have a problem. i have been using an FFT method for 1D arrays. now i need to extend the code for 2D arrays..i thought it would be simple and i managed to implement the FFT method...
4
by: Patrick | last post by:
Hello All, I am new to xml and trying to make it work. I'm having a bit of trouble with for-each loops. I have this xml document; <http://ocgserv.marine.usf.edu/patrick/xml/test_xml_copy.xml>...
5
by: IanT | last post by:
Public Class MyForEachBug ' Public Class MyData Public Element As String Public Group() As String = {"a", "b", "c"} End Class ' Public Sub New() ' Dim Element As String
7
by: GHZ | last post by:
Is this the best way to test every item in a list? def alltrue(f,l): return reduce(bool.__and__,map(f,l)) def onetrue(f,l): return reduce(bool.__or__,map(f,l)) False
29
by: Virtual_X | last post by:
As in IEEE754 double consist of sign bit 11 bits for exponent 52 bits for fraction i write this code to print double parts as it explained in ieee754 i want to know if the code contain any...
1
by: alfiecrosby | last post by:
Hi... this is my first time ti post here... I have a question regarding my PHP study... How do I find out if an array has values posted to each of its elements? I need to know that EVERY...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.