[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

xsl:sort


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

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 <=
Keywords
xsl