473,796 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pagination using xsl as well as sorting

26 New Member
Hi All
I have an urgent issue where I m transforming an xml structure into html page using
xslt .
since data is more , I need to do Pagination .Also there is an option to do sorting of data on final rendered html page. from client side.
for ex , if I do call to google search API for getting restaurant info for a city in form of xml. Then I need to write an xsl file to transform xml data in html page
with pagination and sorting enabled.
Expand|Select|Wrap|Line Numbers
  1. <restaurents>
  2.   <restaurent>
  3.     <RestaurantId>1</RestaurantId>
  4.     <title>abc</title>    
  5.     <neighborhood>Secundrabad</neighborhood>    
  6.     <Address>411 University St,hyderabad</Address>
  7.     <reviews>0</reviews>
  8.     <Phone>(206) 621-1984</Phone>
  9.   </restaurent>
  10.   <restaurent>
  11.     <RestaurantId>2</RestaurantId>
  12.     <title>Capital Grill</title>    
  13.     <neighborhood>Secundrabad</neighborhood>    
  14.     <Address>1301 4th Ave,hyderabad</Address>
  15.     <reviews>1</reviews>
  16.     <Phone>(206) 382-0900</Phone>
  17.   </restaurent>  
  18.   <restaurent>
  19.     <RestaurantId>7</RestaurantId>
  20.     <title>Dukes Chowder Bar</title>    
  21.     <neighborhood>Secundrabad</neighborhood>    
  22.     <Address>1325 4th Ave,hyderabad</Address>
  23.     <reviews>1</reviews>
  24.     <Phone>(206) 340-8840</Phone>
  25.   </restaurent>
  26.   <restaurent>
  27.     <RestaurantId>8</RestaurantId>
  28.     <title>Original Deli</title>    
  29.     <neighborhood>Secundrabad</neighborhood>    
  30.     <Address>1215 4th Ave Ste A-B,hyderabad</Address>
  31.     <Phone>(206) 622-2271</Phone>
  32.   </restaurent>
  33.   <restaurent>
  34.     <RestaurantId>9</RestaurantId>
  35.     <title>Caffe Migliore</title>    
  36.     <neighborhood>Secundrabad</neighborhood>    
  37.     <Address>1215 4th Ave Ste 100,hyderabad</Address>
  38.     <reviews>2</reviews>
  39.     <Phone>(206) 624-9893</Phone>
  40.   </restaurent>
  41. </restaurents>
Mar 13 '08 #1
3 3286
saran3b2
19 New Member
hi,

I can't get ur qusetion. Please resend ur queries briefly & clearly with expect output.
Mar 14 '08 #2
gagonm
26 New Member
basically my problem is that I m using xml and xsl to transform data into xhtml
and on the final rendered html , I should be able to do pagination and sorting of data .please lemme know if u didn't got problem clearly
Mar 15 '08 #3
jkmyoung
2,057 Recognized Expert Top Contributor
pagination? Are you using xsl:fo?

sorting example:
<xsl:for-each select="restaur ent">
<xsl:sort select="title"/>
...
</xsl:for-each>

Also, your spelling of restaurant is inconsistent, may cause problems later.
Mar 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3331
by: Chaprasi | last post by:
hey guys I was wondering if anyone knows about any pagination and sorting in ASP.Net 2.0 with the <asp:Repeater> control. Thanks, Chaprasi
2
2329
by: Chris H | last post by:
I am having a problem with pagination, basically the problem is happening in the "PREV / NUMBERS / NEXT" links, it appears as if the reason is becasue the increment and decrement operators aren't functioning or the $page variable isnt working in that part of the code... Below is the link to the working but broken page.. as well as the main part of my code... Hopefully someone can explain why the operators arent working or maybe see what i...
3
1882
by: howardr101 | last post by:
Hi, I'm really new to this XSL stuff and there's a lot of information out there on the web, I just can't seem to find a definitive answer to my question, hence...... In FO, I know that you define a block and use the keep-together attribute to specify whether or not the block should be split over multiple pages - unless the block itself is longer than a page.
4
3650
by: Ed Jay | last post by:
I generate a DHTML page (a medical report) with dynamically generated text based on user input (answers to questions). The page length changes dynamically. I desire that when the page is printed and reaches a specific length, it terminates printing that page, prints a page number, and then begins to print the next page using the same header and format as the previous page. The page uses no tables or paragraph elements, only CSS. IOW, I...
4
2183
by: comp.lang.php | last post by:
'll try to explain this as clearly as possible, sorry if it's unclear. You have in your directory /foo 42 images You have in your database metadata for 30 out of those 42 images You have to display all 42 images in the /foo directory whether they have database metadata or not. If any of the 42 images have metadata, you must display the metadata,
2
4612
by: rmturner76 | last post by:
I have a need to perform pagination while using dynamic sorting. As an exmaple - SELECT TOP(10) * FROM ( SELECT TextColumn, DecimalColumn, ROW_NUMER() OVER ( ORDER BY CASE @x
1
6852
by: shalini jain | last post by:
Hi, I want to know how can we do pagination using XSL. There are number of tutorials available on pagination using PHP but nothing with XSL. i am really stuck with my code. Below is the code that i have written for pagination but it displays the link of all the pages at one go i.e. if i have 8 pages showing 10 results per page than it shows links for all 8 pages. Previous 1-10 11-20 21-30 31-40 41-50 51-60 61-70 71-80 Next i want to...
16
2782
by: gnawz | last post by:
I have a pagination function I am using in a file called functions.php as below<? //Pagination functions function getPagingQuery($sql, $itemPerPage = 10) { if (isset($_GET) && (int)$_GET > 0) { $page = (int)$_GET; } else { $page = 1; } // start fetching from this row number $offset = ($page - 1) * $itemPerPage; return $sql . " LIMIT $offset, $itemPerPage"; } /* Get the links to navigate between...
1
3557
markrawlingson
by: markrawlingson | last post by:
Hello, For starters: Yes, I am new to asp.net, however I hold a good 9-10 years of experience working with classic asp and am only just now upgrading my skills. I'm picking asp.net up pretty quickly but I'm running into a stumbling block that I just can't seem to get around. I think I know what the problem is, and I'm pretty confident in a work around, but it's not quite what I had hoped for so I thought I'd pick some of the experts brains...
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.