473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

xslt: sorting on the client side - cross browser!

Hi

I feel I'll be asking for someone to turn water into wine
before this happens, but just in case!

I'd like to have a page that provides a basic xml document
with an xslt that defines the default sorting. Say it's in
a table sorted by name with columns age and height.

Then, when the user clicks on another column heading, this
kicks of a (perhaps javascript) call to change the xslt
sort parameter and reformat the page. This would all take
place on the client side, and work on mozilla 1.3 and IE5.5
and higher.

Is this possible? I realise it's a big ask!!

Right now I'm still hoping against hope.

Someone put me out of my misery. ;)

Thanks,

Ben
Jul 20 '05 #1
6 5175
Pass the name of the sort column and the sort order and the datatype of the
sort field as parameters to the xslt transformation,

See for example:
http://www.dpawson.co.uk/xsl/sect2/N6461.html#d6859e950
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Ben Fitzgerald" <bm********@ukonline.co.uk> wrote in message
news:sl***********************@home01.london...
Hi

I feel I'll be asking for someone to turn water into wine
before this happens, but just in case!

I'd like to have a page that provides a basic xml document
with an xslt that defines the default sorting. Say it's in
a table sorted by name with columns age and height.

Then, when the user clicks on another column heading, this
kicks of a (perhaps javascript) call to change the xslt
sort parameter and reformat the page. This would all take
place on the client side, and work on mozilla 1.3 and IE5.5
and higher.

Is this possible? I realise it's a big ask!!

Right now I'm still hoping against hope.

Someone put me out of my misery. ;)

Thanks,

Ben

Jul 20 '05 #2
Dimitre Novatchev wrote:
Pass the name of the sort column and the sort order and the datatype
of the sort field as parameters to the xslt transformation,

See for example:
http://www.dpawson.co.uk/xsl/sect2/N6461.html#d6859e950

"Ben Fitzgerald" wrote
...Then, when the user clicks on another column heading, this
kicks of a (perhaps javascript) call to change the xslt
sort parameter and reformat the page. This would all take
place on the client side, and work on mozilla 1.3 and IE5.5
and higher.


You'll also need the Mozilla XSLT javascript interface
<url:http://www.mozilla.org/projects/xslt/js-interface.html>
and the Mozilla DOMParser [for translating XSLT output to DOM elements]
url:http://www.xulplanet.com/tutorials/xulqa/q_parsexul.html>

For passing params to a clientside XSLT transformation in Explorer you
would require installation of the MSXML toolkit extensions, there's an
example over at <url:http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/xmlsdk/htm/xsl_interactive_9zeb.asp>. No DOMParser
available for Explorer, you'll need to update the page using innerHTML.

--
Wired Earp
Wunderbyte
Jul 20 '05 #3
For passing params to a clientside XSLT transformation in Explorer you
would require installation of the MSXML toolkit extensions, there's an
example over at <url:http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/xmlsdk/htm/xsl_interactive_9zeb.asp>.


This link is to an example of using MSXML in ASP.

Passing external parameters to an MSXML transformation is most easily
accomplished using the IXSLProcessor.addParameter() method.

The place to read about this is the MSXML4 or MSXML3 SDK documentation.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #4
Dimitre Novatchev wrote:
This link is to an example of using MSXML in ASP.
Notice the <%@LANGUAGE="JavaScript"%> declaration. The javascript part of
the deal is perfectly valid for clientside operations.
Passing external parameters to an MSXML transformation is most easily
accomplished using the IXSLProcessor.addParameter() method.
Which is what the example examplifies.
The place to read about this is the MSXML4 or MSXML3 SDK documentation.


you are right; there is a better example over at
<url:http://msdn.microsoft.com/library/de...l=/library/en-
us/xmlsdk/htm/xml_obj_ixslprocessor_9j8y.asp> - at least if you stick to
the first example on the page.
--
Wired Earp
Wunderbyte
Jul 20 '05 #5
I wrote:
there is a better example over at
<url:http://msdn.microsoft.com/library/de...l=/library/en-
us/xmlsdk/htm/xml_obj_ixslprocessor_9j8y.asp>


Except that this example doesn't add params. Sorry about the confusement!

--
Wired Earp
Wunderbyte
Jul 20 '05 #6
I wrote:
Sorry about the confusement!


Really digging a hole for myself here, but I would like to draw attention
away from aforementioned Mozilla DOMParser - you can dump the
XSLTProcessors output directly into the DOM structure:

var oSchema = document.implementation.createDocument ( "", "", null );
var oOutput = document.implementation.createDocument ( "", "", null );
oTransform.load ( "stylesheet.xsl" );

// when stylesheet is loaded
document.documentElement.appendChild
( new XSLTProcessor().transformToFragment
( this.oSchema, this.oOutput ).firstChild );

The wonders of Mozilla.
--
Wired Earp
Wunderbyte
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hayko Riemenschneider | last post by:
Hi! I've got me an XSL tranformation stylesheet for my XML file. In the XSL file I now wish to use PHP to do some scripting. So I thought I'll use the PIs like this: ...
9
by: Jeff Rubard | last post by:
I am curious to know whether anyone has experience using XSLT for web XML (non-XHTML) styling, either with CSS or standalone. I myself have engaged in rather unsuccessful experiments with the...
5
by: Mike Judkins | last post by:
I'm looking for examples of websites (preferably large and well known companies, not personal sites or developer-to-developer sites) that use XML and XSLT as a technology platform from which to...
12
by: gipsy boy | last post by:
Hello, I have sort of a big problem. I would really appreciate any help you could give me. I made a web service in C++ that throws XML to the client (browser). But, the XSLT transormation...
7
by: RC | last post by:
First, let me say I couldn't find a group discuss XML/XSLT. So I only choose the closest groups to post this message. Here is part of my *.xsl file <xsl:stylesheet...
4
by: Stephen | last post by:
I have the following that outputs an xml file to a div using ajax: <script type="text/javascript"> function ajaxXML(url,control_id){ if (document.getElementById) { var x =...
5
by: John A Grandy | last post by:
is it possible to write a vb.net code (intended to run on the client-side) that would invoke an instance of IE, have it download a page from a certain URL, and then pre-populate some of the...
1
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all...
6
by: bcochofel | last post by:
I'm using xsl to list an xml file that contains something like: sites, tag and weight. I'm listing this in a table with the following titles: | URL | TAG | WEIGHT (each title his a link) What...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.