• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xslt pagnation help...

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 in advance.
--Zoe
--xsl:
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
version='1.0' >
<xsl utput doctype-
system='http://www.wapforum.org/DTD/wml_1.1.xml'/>
<!-- declare param -->
<xsl aram name="Page" select="0" />
<xsl aram name="PageSize" select="5" />
<!-- start from here -->
<xsl:template match="/">
<wml>
<card id="message">
<p>
<select name="MAILMSGCONTENT" title="MAILMSGCONTENT">
<xsl:for-each
select="email_client/email_session_config/user_email_msgs/email_msg">

<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() <= $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="email_client/email_session_config/default_email_msgs/email_ms
g">
<xsl:if test="position() >= ($Page * $PageSize) + 1">
<xsl:if test="position() <= $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'>-->
<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>
</email_client>
 
reply
    Bookmark Topic Watch Topic
  • New Topic