You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Konstantin Agouros <Ko...@netage.de> on 2000/08/31 10:03:40 UTC

Sorting LDAP-Output

Hi,

I am trying to do our companies Phonelist using the LDAP-Connector.
Since the LDAP-Server (exchange \:() doesn't give me sorted outpur, I tried
to sort it in the xsl-file by the sn-Attribute, but it doesn't work.
Here is the Part from the xsl-file in question:

-------------------------------------------------------
 <xsl:template match="ldapsearch">
        <table bordercolor="#000000" bgcolor="#FFFFEE" width="100%" cellpadding="0" cellspacing="0">
          <xsl:foreach select="searchresult" order-by="- sn">
                <tr>
                        <th align="left" colspan="2" bgcolor="white">
                        <A> <xsl:attribute name="href"> 
                              <xsl:text>mailto:</xsl:text><xsl:value-of select="mail"/>
                            </xsl:attribute>
                            <xsl:value-of select="givenName"/><xsl:text> </xsl:text><xsl:value-of select="sn"/>
                        </A>
                        </th>
                </tr>
                <tr>
                        <td width="20%" align="left" bgcolor="#c0c0c0">
                                <xsl:text>Tel.: </xsl:text><xsl:value-of select="telephoneNumber"/><br/>
                                <xsl:text>Mobil:</xsl:text><xsl:value-of select="mobile"/><br/>
                                <xsl:text>Mobil (privat):</xsl:text><xsl:value-of select="pager"/><br/>
                                <xsl:text>Buero:</xsl:text><xsl:value-of select="physicalDeliveryOfficeName"/><br/>
                        </td>
                </tr>
          </xsl:foreach>
        </table>
        <p/>   
  </xsl:template>
----------------------------------------------------------
Someone could give me a hint (I came across order-by after looking at xml101.com

Konstantin

-- 
Konstantin Agouros - NetAge Solutions, Dingolfinger Str. 6, 81673 Muenchen
Tel.: 089 666584-0, Fax: 089 666584-11, Email: Konstantin.Agouros@netage.de
--------------------------------------------------------------------------
Black holes are, where god divided by zero.

Re: Sorting LDAP-Output

Posted by Ulrich Mayring <ul...@denic.de>.
Konstantin Agouros wrote:
> 
> On Thu, Aug 31, 2000 at 10:03:40AM +0200, Konstantin Agouros wrote:
> Ok sometimes it helps to read right and give the apache a kill -HUP.
> Reading right means substituting foreach with for-each but now xalan
> doesn't
> like me:
> org.apache.xalan.xslt.XSLProcessorException:
>                              at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1676)
> at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1581)
> Anyone has a comment on this?

An error in your XSL file probably :-)

What I would suggest is to use xsl:sort instead.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: Sorting LDAP-Output

Posted by Konstantin Agouros <Ko...@netage.de>.
On Thu, Aug 31, 2000 at 10:03:40AM +0200, Konstantin Agouros wrote:
Ok sometimes it helps to read right and give the apache a kill -HUP.
Reading right means substituting foreach with for-each but now xalan doesn't
like me:
org.apache.xalan.xslt.XSLProcessorException: 
                             at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1676)
                             at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1581)

Anyone has a comment on this?

Konstantin
> 
> -------------------------------------------------------
>  <xsl:template match="ldapsearch">
>         <table bordercolor="#000000" bgcolor="#FFFFEE" width="100%" cellpadding="0" cellspacing="0">
>           <xsl:foreach select="searchresult" order-by="- sn">
>                 <tr>
>                         <th align="left" colspan="2" bgcolor="white">
>                         <A> <xsl:attribute name="href"> 
>                               <xsl:text>mailto:</xsl:text><xsl:value-of select="mail"/>
>                             </xsl:attribute>
>                             <xsl:value-of select="givenName"/><xsl:text> </xsl:text><xsl:value-of select="sn"/>
>                         </A>
>                         </th>
>                 </tr>
>                 <tr>
>                         <td width="20%" align="left" bgcolor="#c0c0c0">
>                                 <xsl:text>Tel.: </xsl:text><xsl:value-of select="telephoneNumber"/><br/>
>                                 <xsl:text>Mobil:</xsl:text><xsl:value-of select="mobile"/><br/>
>                                 <xsl:text>Mobil (privat):</xsl:text><xsl:value-of select="pager"/><br/>
>                                 <xsl:text>Buero:</xsl:text><xsl:value-of select="physicalDeliveryOfficeName"/><br/>
>                         </td>
>                 </tr>
>           </xsl:foreach>
>         </table>
>         <p/>   
>   </xsl:template>
> ----------------------------------------------------------
> Someone could give me a hint (I came across order-by after looking at xml101.com
> 
> Konstantin
> 
> -- 
> Konstantin Agouros - NetAge Solutions, Dingolfinger Str. 6, 81673 Muenchen
> Tel.: 089 666584-0, Fax: 089 666584-11, Email: Konstantin.Agouros@netage.de
> --------------------------------------------------------------------------
> Black holes are, where god divided by zero.

-- 
Konstantin Agouros - NetAge Solutions, Dingolfinger Str. 6, 81673 Muenchen
Tel.: 089 666584-0, Fax: 089 666584-11, Email: Konstantin.Agouros@netage.de
--------------------------------------------------------------------------
Black holes are, where god divided by zero.

Re: Sorting LDAP-Output

Posted by SaiRam Mattancheril <sa...@fedex.com>.
Here is a fragment from a style sheet i am using. Hope it helps.

Thanks
sai


<xsl:template match="ldapsearch">
  <xsl:apply-templates select="searchresult">
       <xsl:sort data-type="text" order="ascending" select="departmentnumber" />
       <xsl:sort data-type="text" order="descending" select="managementlevel" />
       <xsl:sort data-type="text" select="givenname" />
  </xsl:apply-templates>
 </xsl:template>


Konstantin Agouros wrote:

> Hi,
>
> I am trying to do our companies Phonelist using the LDAP-Connector.
> Since the LDAP-Server (exchange \:() doesn't give me sorted outpur, I tried
> to sort it in the xsl-file by the sn-Attribute, but it doesn't work.
> Here is the Part from the xsl-file in question:
>
> -------------------------------------------------------
>  <xsl:template match="ldapsearch">
>         <table bordercolor="#000000" bgcolor="#FFFFEE" width="100%" cellpadding="0" cellspacing="0">
>           <xsl:foreach select="searchresult" order-by="- sn">
>                 <tr>
>                         <th align="left" colspan="2" bgcolor="white">
>                         <A> <xsl:attribute name="href">
>                               <xsl:text>mailto:</xsl:text><xsl:value-of select="mail"/>
>                             </xsl:attribute>
>                             <xsl:value-of select="givenName"/><xsl:text> </xsl:text><xsl:value-of select="sn"/>
>                         </A>
>                         </th>
>                 </tr>
>                 <tr>
>                         <td width="20%" align="left" bgcolor="#c0c0c0">
>                                 <xsl:text>Tel.: </xsl:text><xsl:value-of select="telephoneNumber"/><br/>
>                                 <xsl:text>Mobil:</xsl:text><xsl:value-of select="mobile"/><br/>
>                                 <xsl:text>Mobil (privat):</xsl:text><xsl:value-of select="pager"/><br/>
>                                 <xsl:text>Buero:</xsl:text><xsl:value-of select="physicalDeliveryOfficeName"/><br/>
>                         </td>
>                 </tr>
>           </xsl:foreach>
>         </table>
>         <p/>
>   </xsl:template>
> ----------------------------------------------------------
> Someone could give me a hint (I came across order-by after looking at xml101.com
>
> Konstantin
>
> --
> Konstantin Agouros - NetAge Solutions, Dingolfinger Str. 6, 81673 Muenchen
> Tel.: 089 666584-0, Fax: 089 666584-11, Email: Konstantin.Agouros@netage.de
> --------------------------------------------------------------------------
> Black holes are, where god divided by zero.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org