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

Re: xslt pagnation help...

Subject: Re: xslt pagnation help...
From: "Zoe Peng" <zoe@xxxxxxxxxxxx>
Date: Mon, 12 Aug 2002 02:05:50 -0400
Re:  xslt pagnation help...
Hi Joerg, 
Yes. It's pretty much I need for my stylesheet.
position() 0-4 (on page 0)
position 5-10 (on page 1) 
position 11-15 (on page 2)
The problem: when I click option [More], it needs to link to #card 
which is from page0 to page1 and so on. The statement I use didn't 
perform this functionality. Any suggestions? Thanks in advance.
--Zoe

> I don't know exactly what your problem is, but I would suggest 
merging 
> the both email message types:
> 
> <?xml version="1.0" ?>
> <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
> version='1.0' >
> <xsl:output doctype-system='http://www.wapforum.org/DTD/wml_1.1.xml'/>
> 
> <!-- declare param -->
> <xsl:param name="Page" select="0" />
> <xsl:param name="PageSize" select="5" />
> 
> <!-- start from here -->
> <xsl:template match="/">
>    <wml>
>      <card id="message">
>        <p>
>          <select name="MAILMSGCONTENT" title="MAILMSGCONTENT">
>            <xsl:apply-templates 
> select="tm_email_client/email_session_config"/>
>            <option onpick="#card">More</option>
>          </select>
>          <a href="#reply">Select</a>
>          <anchor>Back<prev/></anchor>
>       </p>
>    </card>
> </wml>
> </xsl:template>
> 
> <xsl:template match="email_session_config">
>    <xsl:for-each select="( user_email_msgs/email_msg | 
> default_email_msgs/email_msg ) [position() > ($Page * $PageSize)] 
> [position() &lt;= $PageSize]">
>      <option value="{em_msg_subj}">
>        <xsl:value-of select="em_msg_subj"/>
>      </option>
>    </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
> 
> Explanation for the for-each statement:
> 
> Select all user_email_msgs/email_msg and all 
> default_email_msgs/email_msg and create a UNION of these both node 
sets 
> (=> 1 node set). From this merged node set select all elements, whose 
> position() is greater than 0 (on page 0) or 5 (on page 1) and so on 
> (first predicate). From the rest (position() is calculated again) 
select 
> all the elements whose position() id less than or equals 5, so 5 
> elements are selected (or less on the last page).
> 
> Does this stylesheet what you want??
> 
> Regards,
> 
> Joerg


 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.