Re: [xsl] Order By with XSL

Subject: Re: [xsl] Order By with XSL
From: Shashi.Bhushan@xxxxxxxxx
Date: Mon, 29 Mar 2004 15:38:52 +0530
This example is using MS-XML4.0 parsing
In my project limitations is that i have to using Ms-XML 2.0 compatible
parser.

Is any other one  please help me on this issue.this is critical part in my
project.




                                                                                                                                       
                      "Andrew Curry"                                                                                                   
                      <andrew.curry@pa.        To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>                                             
                      press.net>               cc:                                                                                     
                                               Subject:  Re: [xsl] Order By with XSL                                                   
                      03/29/2004 03:30                                                                                                 
                      PM                                                                                                               
                      Please respond to                                                                                                
                      xsl-list                                                                                                         
                                                                                                                                       
                                                                                                                                       




Im not that familiar with MSXML using javascript to dynamically sort your
xml, your syntax in your XSL looks ok. If you parse on the back end it
would
probably get around the problem but as i dont know MSXML and its
limitations
too well im not sure if this is best for your problem or not. Im sure
someone else on the list will have more experience of this than myself.

I found this which may be of some use

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/

xsl_browsing1_00l0.asp

----- Original Message -----
From: <Shashi.Bhushan@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, March 29, 2004 10:50 AM
Subject: Re: [xsl] Order By with XSL


>
> Hi Andrew
>
> How can i solve the browser crash problem.Is we  elminate using java side
> parsing.
>
>
>
>
>
>                       "Andrew Curry"
>                       <andrew.curry@pa.        To:
<xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>                       press.net>               cc:
>                                                Subject:  Re: [xsl] Order
By with XSL
>                       03/29/2004 02:33
>                       PM
>                       Please respond to
>                       xsl-list

>
>
>
>
>
>
> is this using msxml??
>
> ----- Original Message -----
> From: <Shashi.Bhushan@xxxxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> Sent: Monday, March 29, 2004 9:49 AM
> Subject: Re: [xsl] Order By with XSL
>
>
> >
> > I am using these lines for sorting in three different file
> >
> >  <xsl:apply-templates select="Result//ReferencedBy">
> >             <xsl:sort select="../@title"/>
> >       </xsl:apply-templates>
> > -------------------
> >  <xsl:apply-templates select="Result//ReferencedBy">
> >             <xsl:sort select="@title"/>
> >       </xsl:apply-templates>
> > ----------------------------
> >  <xsl:apply-templates select="Result//ReferencedBy">
> >             <xsl:sort select="../@identifier"/>
> > </xsl:apply-templates>
> >
> > and my xml file is
> > -----------
> >
> > <tree>
> > <Result title='9.2.1 - Prepare Method abc Route Map' open='' save=''
icon
> > ='Activity.gif' objectid='881E4C1C-3D0E-4061-B685-DDE185FC95B5'
> objecttype
> > ='7CC1B384-D273-45E0-83D9-75203AE52195' identifier='' exceptionicon=''
>
> >             <ReferencedBy title='9 - Project Management (9.2 - Project
> > Planning (9.2.1 - Prepare Method abc Route Map))'           open
> > ='Phase_Overview\9_Phase_Overview.htm' nodeid='' releaseno=''
> categoryid=''
> > categoryverno='' />
> > </Result>
> > <Result title='Information Architecture in Method abc' open
> > ='Content\6.10\Accelerator\A0350.htm' save='' icon='sppt.gif' objectid
> > ='06D9262F-AB27-48FB-B434-09EC6C31A14F' objecttype
> > ='D6E0D253-7112-4D1C-B593-1470205A7A51' identifier='A0350'
> exceptionicon=''
> > >
> >             <ReferencedBy title='1 - Situation Definition (1.2 -
Baseline
> > Internal Environment (1.2.11 - Understand Current Information
Management
> > Approach (Information Architecture in Method abc)))' open
> > ='Phase_Overview\1_Phase_Overview.htm' nodeid='' releaseno=''
> categoryid=''
> > categoryverno='' />
> >             <ReferencedBy title='3 - Solution Design (3.1 - High Level
> > Solution Analysis &amp; Design (3.1.7 - High Level Information Analysis
> > &amp; Design (Information Architecture in Method abc)))' open
> > ='Phase_Overview\3_Phase_Overview.htm' nodeid='' releaseno=''
> categoryid=''
> > categoryverno='' />
> > </Result>
> > </tree>
> >
> > and xsl i used is
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> > <xsl:template match="/SearchResult">
> > <table border="1" cellpadding="0" cellspacing="0"  bgcolor="#007f82">
> >    <thead>
> >       <tr border="1">
> >        <th width="25%" align="center"><input name="display"
type="button"
> > class="submitSearch"
> >
> > onclick="javascript:sort('1')" value="Display" width="25%" /></th>
> >        <th width="58%" align="center"><input name="reference"
> type="button"
> > class="submitSearch"
> >
> > onclick="javascript:sort('2')" value ="Referenced By" width="50%"
/></th>
> >       <th width="4%"  align="center"><font size='1' color
> > ='white'>Format</font></th>
> >         <th  width="10%" align="center" ><input name="identifier" type
> > ="button"   class="submitSearch"
> >
> > onclick="javascript:sort('3')" value="Identifier" width="25%" /></th>
> >      </tr>
> >      </thead>
> > <tbody>
> >        <xsl:apply-templates select="Result//ReferencedBy">
> >             <xsl:sort select="../@title"/>
> >       </xsl:apply-templates>
> > </tbody>
> > <tr><td colspan="4"><xsl:text> &#160;  </xsl:text></td></tr>
> > <tr><td colspan="4"><b>No.of Records in Search:-<xsl:value-of select
> > ="count(Result/ReferencedBy)"/></b></td></tr>
> > </table>
> > </xsl:template>
> > <xsl:template match="ReferencedBy">
> >       <tr bgcolor="#007f82" border="1">
> >
> >           <td  width="25%" border="1" >
> >
> >           <a class="tdbordersearch">
> >       <xsl:attribute name="href">
> >
> >                   <xsl:if test="not(normalize-space(../@open)) and
> > not(normalize-space(../@save)) ">
> >                         ../../<xsl:value-of select="../@open"/>
> >                   </xsl:if>
> >                   <xsl:if test="not(normalize-space(../@save))">
> >                         <xsl:if test="substring(../@open,0,5)='http'">
> >                               <xsl:value-of select="../@open"/>
> >                         </xsl:if>
> >                         <xsl:if test="substring(@open,0,5)!='http'">
> >
> >                                     ../../<xsl:value-of
> select="../@open"/>
> >                         </xsl:if>
> >                   </xsl:if>
> >                   <xsl:if test="string(../@save)">
> >                         ../../<xsl:value-of select="../@save"/>
> >                   </xsl:if>
> >             </xsl:attribute>
> >
> >                 <xsl:value-of select="../@title"/>
> >                 </a>
> >           </td>
> >            <td  width="55%" border="1">
> >
> >                   <a class="tdbordersearch">
> >
> > <xsl:attribute name="href">
> >                               ../../<xsl:value-of select="@open"/>
> >                         </xsl:attribute>
> >                         <xsl:value-of select='@title'/>
> >                   </a>
> >            </td>
> >            <td class="tdbordersearch" width="4%" border="1">
> >
> >             <xsl:if test="normalize-space(../@exceptionicon)">
> >                   <img>
> >                     <xsl:attribute name
> > ="src">images/usa.gif</xsl:attribute>
> >                     <xsl:attribute name="width">100%</xsl:attribute>
> >
> >                   </img>
> >             </xsl:if>
> >             <xsl:if test="not(normalize-space(../@exceptionicon))">
> >                   <xsl:text> &#160;  </xsl:text>
> >             </xsl:if>
> >            </td>
> >            <td class="tdbordersearch" width="10%" border="1" >
> >
> > <xsl:value-of select="../@identifier"/><xsl:text> &#160;
> </xsl:text></td>
> >
> >         </tr>
> >
> >
> >
> >
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >
> >
> > It's working fine but the problem is browser will crash after some
click
> >
> >
> >
> >
> >
> >                       "Andrew Curry"
> >                       <andrew.curry@pa.        To:
> <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> >                       press.net>               cc:
> >                                                Subject:  Re: [xsl]
Order
> By with XSL
> >                       03/29/2004 02:12
> >                       PM
> >                       Please respond to
> >                       xsl-list
> >
> >
> >
> >
> >
> >
> > You can sort that way yes. Can you send an example xml file and the
> sorting
> > xml files. It will make it easier to get you an answer.
> > ----- Original Message -----
> > From: <Shashi.Bhushan@xxxxxxxxx>
> > To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > Cc: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > Sent: Monday, March 29, 2004 9:35 AM
> > Subject: Re: [xsl] Order By with XSL
> >
> >
> > >
> > > I have 3 keys and want sorting based on them.For that i have written
3
> > > different xsl file. is it write way for sorting.
> > >
> > >
> > >
> > >
> > >                       "Andrew Curry"
> > >                       <andrew.curry@pa.        To:
> > <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > >                       press.net>               cc:
> > >                                                Subject:  Re: [xsl]
> Order
> > By with XSL
> > >                       03/29/2004 02:01
> > >                       PM
> > >                       Please respond to
> > >                       xsl-list
> > >
> > >
> > >
> > >
> > >
> > >
> > > <xsl:sort...> should do the trick
> > > Have you an example of what you want sorting?
> > > ----- Original Message -----
> > > From: "Gianni Ferrari" <gferrari@xxxxxx>
> > > To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > > Sent: Monday, March 29, 2004 9:30 AM
> > > Subject: [xsl] Order By with XSL
> > >
> > >
> > > > Good morning experts, and good start of the week,
> > > > i have a question for you: when i show the result of my stylesheet,
I
> > > would
> > > > like to order all for a tag. There is a function or a namespace for
> it?
> > > > Thank you, i'll wait a your reply.
> > > > Regards
> > > >    Gianni
> > > > ***************************************
> > > > G.P.I. S.r.l.
> > > > Via Ragazzi del 99, 13
> > > > 38100 Trento (TN) - Italia
> > > > Tel. 0461-381500 - Fax 0461-381599
> > > > Sede di Cerignola (FG)
> > > > Tel. 0885-417950 - Fax 0885-417942
> > > > ***************************************
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Whilst this email has been checked for all known viruses, recipients
> > should undertake their own virus checking as Xansa will not accept any
> > liability whatsoever.
> > >
> > > This email and any files transmitted with it are confidential and
> > protected by client privilege.  It is solely for the use of the
intended
> > recipient.
> > > Please delete it and notify the sender if you have received it in
> > > error. Unauthorised use is prohibited.
> > >
> > > Any opinions expressed in this email are those of the individual and
> not
> > > necessarily the organisation.
> > >      Xansa, Registered Office: 420 Thames Valley Park Drive,
> > >      Thames Valley Park, Reading, RG6 1PU, UK.
> > >      Registered in England No.1000954.
> > >      t  +44 (0)8702 416181
> > >      w  www.xansa.com
> >
> >
> >
> >
> >
> >
> >
> > Whilst this email has been checked for all known viruses, recipients
> should undertake their own virus checking as Xansa will not accept any
> liability whatsoever.
> >
> > This email and any files transmitted with it are confidential and
> protected by client privilege.  It is solely for the use of the intended
> recipient.
> > Please delete it and notify the sender if you have received it in
> > error. Unauthorised use is prohibited.
> >
> > Any opinions expressed in this email are those of the individual and
not
> > necessarily the organisation.
> >      Xansa, Registered Office: 420 Thames Valley Park Drive,
> >      Thames Valley Park, Reading, RG6 1PU, UK.
> >      Registered in England No.1000954.
> >      t  +44 (0)8702 416181
> >      w  www.xansa.com
>
>
>
>
>
>
>
> Whilst this email has been checked for all known viruses, recipients
should undertake their own virus checking as Xansa will not accept any
liability whatsoever.
>
> This email and any files transmitted with it are confidential and
protected by client privilege.  It is solely for the use of the intended
recipient.
> Please delete it and notify the sender if you have received it in
> error. Unauthorised use is prohibited.
>
> Any opinions expressed in this email are those of the individual and not
> necessarily the organisation.
>      Xansa, Registered Office: 420 Thames Valley Park Drive,
>      Thames Valley Park, Reading, RG6 1PU, UK.
>      Registered in England No.1000954.
>      t  +44 (0)8702 416181
>      w  www.xansa.com







Whilst this email has been checked for all known viruses, recipients should undertake their own virus checking as Xansa will not accept any liability whatsoever.

This email and any files transmitted with it are confidential and protected by client privilege.  It is solely for the use of the intended recipient.
Please delete it and notify the sender if you have received it in
error. Unauthorised use is prohibited.

Any opinions expressed in this email are those of the individual and not
necessarily the organisation.
     Xansa, Registered Office: 420 Thames Valley Park Drive,
     Thames Valley Park, Reading, RG6 1PU, UK.
     Registered in England No.1000954.
     t  +44 (0)8702 416181
     w  www.xansa.com

Current Thread