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

xsl:sort

Subject: xsl:sort
From: "Alankar Chowdhury" <alankar@xxxxxxxxxxxxxxxxx>
Date: Thu, 11 May 2000 11:48:09 +0800
xsl if xsl sort
Hey all ...

Here is the question :

I am passing a parameter using
processor.setStylesheetParam("S", "'name'");

Now in my style sheet I can access the parameter like this
<xsl:value-of select="$S">
but if I try to use this

<xsl:sort select="$S"> .. it doesn't work
please help guys

I have added the xsl file below ( and I can asure u the parameter is
passed properly )

<?xml version="1.0" ?>
<!-- Simple layout one table with the referenve feature-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="html" encoding="UTF-8" />

<xsl:param name="searchName" select="'B'"/>
<xsl:param name="S" select="'name'"/>
<xsl:param name="Ext" select="0"/>
<xsl:param name="Email1" select="0"/>
<xsl:param name="Email2" select="0"/>
<xsl:param name="Dept_id" select="0"/>
<xsl:param name="Dept_desc" select="0"/>


<xsl:template match="employees">

  <TABLE BORDER="1" cellspacing="2" cellpadding="4" align="center">
    <TR>
      <TD STYLE="background-color:#998877;
color:white;"><B>Name</B></TD>
      <xsl:if test="$Ext=1">
        <TD STYLE="background-color:#998877;
color:white;"><B>Extension</B></TD>
      </xsl:if>
      <xsl:if test="$Email1=1">
        <TD STYLE="background-color:#998877; color:white;"><B>Intranet
Email Address</B></TD>
      </xsl:if>
      <xsl:if test="$Email2=1">
        <TD STYLE="background-color:#998877; color:white;"><B>Alias
Email Address</B></TD>
      </xsl:if>
      <xsl:if test="$Dept_id=1">
        <TD STYLE="background-color:#998877; color:white;"><B>Department

ID</B></TD>
      </xsl:if>
      <xsl:if test="$Dept_desc=1">
        <TD STYLE="background-color:#998877; color:white;"><B>Department

Description</B></TD>
      </xsl:if>
    </TR>


<xsl:value-of select="$S"/>
    <xsl:for-each select="employee">

    <xsl:sort select="$S"/>  <!-- this doesn't work -->

      <TR>
        <TD STYLE="background-color:#FFFFDD; color:black;">
          <xsl:value-of select="name"/>
        </TD>

        <xsl:if test="$Ext=true()">
          <TD STYLE="background-color:#FFFFDD; color:black;">
            <xsl:value-of select="ext"/>
          </TD>
        </xsl:if>

        <xsl:if test="$Email1=true()">
          <TD STYLE="background-color:#FFFFDD; color:black;">
            <A>
              <xsl:attribute name="HREF">mailto:<xsl:value-of
select="email1"/></xsl:attribute>
              <xsl:value-of select="email1"/>
            </A>
          </TD>
        </xsl:if>

        <xsl:if test="$Email2=true()">
          <TD STYLE="background-color:#FFFFDD; color:black;">
            <xsl:if test="email2[.!='NIL']">
              <A>
                <xsl:attribute name="HREF">mailto:<xsl:value-of
select="email2"/></xsl:attribute>
                <xsl:value-of select="email2"/>
              </A>
            </xsl:if>
            <xsl:if test="email2[.='NIL']">
                <xsl:value-of select="email2"/>
            </xsl:if>
          </TD>
        </xsl:if>

        <xsl:if test="$Dept_id=true()">
          <TD STYLE="background-color:#FFFFDD; color:black;">
            <xsl:value-of select="dept_id"/>
          </TD>
        </xsl:if>

        <xsl:if test="$Dept_desc=true()">
          <TD STYLE="background-color:#FFFFDD; color:black;">
            <xsl:value-of select="dept_desc"/>
          </TD>
        </xsl:if>
      </TR>

    </xsl:for-each>
  </TABLE>
</xsl:template>
</xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • xsl:sort
    • Alankar Chowdhury - Thu, 11 May 2000 11:48:09 +0800 <=

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.