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

Re: Best way to have user decide sort

Subject: Re: Best way to have user decide sort
From: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Mon, 1 Oct 2001 14:23:23 +0100
generic javascript sort
Hello Doug,

a little uncertain at what u mean by 'dynamic sort in SAX', as what u want
can be done easily in cocoon.

in any case u are going to have pass a parameter into your stylesheet
somewhere along the line to represent the decision of the user.

i would either

a) come up with some generic javascript code ( ala chris bayes stuff
www.bayes.co.uk/xml) to take care of IE or with cocoon
b) take advantage of passing params via the url ex.
http://someurl?param1=value

once u've done this u could have the xsl template call itself ( with an <a
href="someurl?param1={$somevalue}"> with just a change in the param, and
when there is some default param value, u know that no choice has been
taken.

as for dealing with the branching for PDF, this could be another param as
flag ex http://someurl?param1=value&pdf=on

HTH, jim fuller


----- Original Message -----
From: "Hewko, Doug" <Doug.Hewko@xxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, October 01, 2001 2:08 PM
Subject:  Best way to have user decide sort


> This is fairly easy to do in DOM, but what is the best way to accomplish a
> dynamic sort in SAX? Here's what I want. When the user first comes to this
> page, it is blank except for a "Choose a letter A B C D..." at the top.
> There will also be an option for output via PDF (another page) and to list
> all categories. The user would click on a letter, example "A" and all
> categories starting with that letter will appear.
>
> I'd prefer to have this to use two XSLs (one for PDF and one for HTML
> output)  but the more I play around I see that I may need 28 XSLs. I have
> yet been able to pass a parameter from one XSL to another. Is there
anyother
> way out, or would having one web page for the "choose one" and one for the
> output be the best, even though the user can change his/her mind. (Select
> "A" and then choose to select "G".)
>
> I did enter the example in
>
"http://www.topxml.com/snippetcentral/main.asp?view=viewsnippet&lang=&id=v20

> 010425122434" except that it is based on a run-time decision. And although
> is requires a parameter be passed from one web page to the XSL, it doesn't
> tell how to do so. Unfortunately, the page it refers to uses ASP to pass a
> parameter, which I am not using.
>
> In DOM, I would create a Javascript code to handle the processing, but my
> impression of SAX is that I should get away from that. (I am using
Cocoon2).
>
>
> XSL:
> <xsl:template match="glossary">
>    ....
> Choose a letter
> <table><thead>
> <td align="center" width="25">A</td>
> <td align="center" width="25">B</td>
> ......
> </thead>
> <xsl:apply-templates name="//category">
>    <xsl:sort select="*[name(.) = $sortfield]"/>
>    </xsl:apply-templates>
> </table>
> </xsl:template>
>
> <xsl:template name="//category">
> <xsl:value-of select="$sortfield"/>
> <xsl:for-each select="//glossaryitem[count(. |
> key('sort-by-category', category)[1]) = 1]">
> <xsl:for-each select="category">
> <xsl:sort select="." />
> <xsl:if
> test="starts-with(category,$sortfield)">
> <H2>
> <xsl:value-of select="." />
> </H2>
> <xsl:value-of select="english_title"/>
> </xsl:if>
> </xsl:for-each>
> </xsl:for-each>
> </xsl:template>
>
> <xsl:template match="text()">
> </xsl:template>
>
>
****************************************************************************
> ***
>
> XML File:
> <glossary>
> <glossaryitem>
> <category>Things</category>
> <english_title>Computer</english_title>
> </glossaryitem>
> <glossaryitem>
> <category>Things</category>
> <category>Animal</category>
> <english_title>Mouse</english_title>
> </glossaryitem>
> <glossaryitem>
> <category>People</category>
> <english_title>Doug Hewko</english_title>
> </glossaryitem>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.