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

Re: using parameters in filters?

Subject: Re: using parameters in filters?
From: "Mattias Konradsson" <preacher@xxxxxxxxxxx>
Date: Sat, 24 Feb 2001 12:51:36 +0100
div parameters
> What you want is 9probably) something more like
>   <xsl:apply-templates select="message[@repliedto = $filter]" />
>
> together with
>   xslProc.addParameter("filter", "False");

argh! there's got to be a better way, this forces me to use this kind of
bungled code, and I can't even use params in sort elements since they can't
be contained in a if clause

<snip>

<xsl:template match="NewDataSet">
  <table border="0" cellspacing="0" cellpadding="0"  width="100%"
bgcolor="">

   <tr bgcolor="#eaeaea">
    <td width="100" onclick="sortMessages('sender')"><div
class="topbutton">Från</div></td>
    <td width="140" onclick="sortMessages('subject')"><div
class="topbutton">Ämne</div></td>
    <td onclick="sortMessages('date ')"><div class="topbutton"
>Skickat</div></td>
   </tr>
  </table>
  <table border="0" cellspacing="0" cellpadding="3"  width="100%"
bgcolor="">

 <tr bgcolor="silver">
 </tr>

  <xsl:choose>
   <xsl:when test="$filterField ='repliedto'">
      <xsl:for-each select="header[RepliedTo = $filterValue]">
       <xsl:sort select="$sortby" order="ascending"/>
       <xsl:apply-templates select="." />
      </xsl:for-each>
   </xsl:when>
   <xsl:when test="$filterField ='dateread'">
      <xsl:for-each select="header[not(DateRead)]">
       <xsl:apply-templates select="." />
      </xsl:for-each>
   </xsl:when>

   <xsl:when test="$filterField ='all'">
      <xsl:for-each select="header">
        <xsl:sort select="$sortby" order="ascending"/>


       <xsl:apply-templates select="." />
      </xsl:for-each>
   </xsl:when>

  </xsl:choose>


  </table>
 </xsl:template>

</snip>

Best Regards
---
Mattias Konradsson


 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.