pagination using xsl as well as sorting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gagonm
    New Member
    • Oct 2007
    • 26

    pagination using xsl as well as sorting

    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.
    Code:
    <restaurents>
      <restaurent>
        <RestaurantId>1</RestaurantId>
        <title>abc</title>    
        <neighborhood>Secundrabad</neighborhood>    
        <Address>411 University St,hyderabad</Address>
        <reviews>0</reviews>
        <Phone>(206) 621-1984</Phone>
      </restaurent>
      <restaurent>
        <RestaurantId>2</RestaurantId>
        <title>Capital Grill</title>    
        <neighborhood>Secundrabad</neighborhood>    
        <Address>1301 4th Ave,hyderabad</Address>
        <reviews>1</reviews>
        <Phone>(206) 382-0900</Phone>
      </restaurent>  
      <restaurent>
        <RestaurantId>7</RestaurantId>
        <title>Dukes Chowder Bar</title>    
        <neighborhood>Secundrabad</neighborhood>    
        <Address>1325 4th Ave,hyderabad</Address>
        <reviews>1</reviews>
        <Phone>(206) 340-8840</Phone>
      </restaurent>
      <restaurent>
        <RestaurantId>8</RestaurantId>
        <title>Original Deli</title>    
        <neighborhood>Secundrabad</neighborhood>    
        <Address>1215 4th Ave Ste A-B,hyderabad</Address>
        <Phone>(206) 622-2271</Phone>
      </restaurent>
      <restaurent>
        <RestaurantId>9</RestaurantId>
        <title>Caffe Migliore</title>    
        <neighborhood>Secundrabad</neighborhood>    
        <Address>1215 4th Ave Ste 100,hyderabad</Address>
        <reviews>2</reviews>
        <Phone>(206) 624-9893</Phone>
      </restaurent>
    </restaurents>
  • saran3b2
    New Member
    • Aug 2007
    • 19

    #2
    hi,

    I can't get ur qusetion. Please resend ur queries briefly & clearly with expect output.
    Last edited by jkmyoung; Mar 17 '08, 03:49 PM. Reason: no quote needed

    Comment

    • gagonm
      New Member
      • Oct 2007
      • 26

      #3
      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

      Comment

      • jkmyoung
        Recognized Expert Top Contributor
        • Mar 2006
        • 2057

        #4
        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.

        Comment

        Working...