[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Implementing user input in XSL
<EWDProductions@a...> wrote to ask - > > For example, I have a list of products, prices, reviews, and shipping prices. > I want to be able to make a drop downlist that has each of the 4 options and > when one is selected, the list is reordered based on that value. For > example, if they chose reviews, it resorts the list based on the best reviews > to worse. > > What I've been able to come up with is a script that will load a different > xsl file to format the xml. 1 file for each option. Now that's not > including reverse odering. I'm on 6 files for one page and if I were to > implement searches and reverse orders, I'd be well over twenty. > This kind of thing is best done on the client as much as possible. This means in javascript, usually. The O'Reilly book by Jon Udell, Practical Internet Groupware, discusses this kind of thing in pages 396 ff, "Polymorphic HTML Widgets". He produces code at the server using perl and cgi methods, but you could use xslt for it. Send the data and some special variables either in hidden fields in forms, or as javascript variables. The client might still have to come back to the server, but not necessarily. For another example, you could look at this url: http://osdacces.nesdis.noaa.gov:8081/satprod/instruments/instrframeset.cfm?i nstr=-1 This page loads over 200K of javascript arrays into one frame. When you make a selection from one of two pick lists, the code selects and displays the data subset in the other frame without ever talking to the server again. Granted, 200K is a little extreme, especially for low-bandwidth modem connections. But once it's loaded, you're all set. This particular page is done using Cold Fusion and a relational database, but you could use XSLT with the data in xml format to do the same thing. Cheers, Tom Passin
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|