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

xslt pagnation help...

Subject: xslt pagnation help...
From: "Zoe Peng" <zoe@xxxxxxxxxxxx>
Date: Fri, 9 Aug 2002 11:42:34 -0400
pagnation
Hi, 
I have an email service(xml document) which I'll allow user to select 
pre-defined messages as email subject when user doing the reply function
(in wml that transform from xslt). 
The question for me is I have too much pre-defined message that I want 
to pagnation them. The pre-defined messages will includes two parts 
which are user pre-defined and default. 
I got problem when I have want to click [[More]] to have next page if I 
devide item into 5. Please help. Thanks. 
--Zoe

--xsl: 
<?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:for-each 
select="tm_email_client/email_session_config/user_email_msgs/email_msg">
  
<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() &lt;= $PageSize + ($PageSize * $Page)">
<xsl:variable name="_usr_em_msg_subj">
<xsl:value-of select="./em_msg_subj"/>
</xsl:variable>
<option value="{$_usr_em_msg_subj}">
<xsl:value-of select="$_usr_em_msg_subj" />
</option>
</xsl:if>
</xsl:if>
</xsl:for-each>

<xsl:for-each 
select="tm_email_client/email_session_config/default_email_msgs/email_ms
g">   

<xsl:if test="position() >= ($Page * $PageSize) + 1">

<xsl:if test="position() &lt;= $PageSize + ($PageSize * $Page)">
<xsl:variable name="_def_em_msg_subj">
<xsl:value-of select="./em_msg_subj"/>
</xsl:variable>
<option value="{$_def_em_msg_subj}">
<xsl:value-of select="$_def_em_msg_subj" />
</option>
</xsl:if>
</xsl:if>
                                            
</xsl:for-each>
<option onpick="#card">More</option>
</select>
<a href="#reply">Select</a>
<anchor>Back<prev/></anchor>
</p>
</card>
</wml>
</xsl:template>
</xsl:stylesheet>


--xml
<?xml version="1.0"?>
<!-- <!DOCTYPE tm_email_client 
SYSTEM 'http://localhost/xml/dtd/tm_email_client.dtd'>-->
<tm_email_client statuscode="0" statusdesc="Mail has been read." 
action="emailreply">
  <email_session_config>
    <user_email_msgs usr_id="user1">
      <email_msg>
        <em_msg_subj>Are you testing?</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>How are you doing?</em_msg_subj>
      </email_msg>
    </user_email_msgs>
    <default_email_msgs>
      <email_msg>
        <em_msg_subj>Yes</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>No</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Please call</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Pick Up Groceries</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Call Home</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Contact School</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Check Post Box</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Call Office</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Appointment Due</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Appointment Cancelled</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Busy</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Will Call Later</em_msg_subj>
      </email_msg>
      <email_msg>
        <em_msg_subj>Call you back</em_msg_subj>
      </email_msg>
    </default_email_msgs>
  </email_session_config>
</tm_email_client>




 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.