473,789 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5201
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********@uko nline.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.c om/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.a ddParameter() 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="Ja vaScript"%> 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.a ddParameter() 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_ixslpro cessor_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_ixslpro cessor_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.implem entation.create Document ( "", "", null );
var oOutput = document.implem entation.create Document ( "", "", null );
oTransform.load ( "stylesheet.xsl " );

// when stylesheet is loaded
document.docume ntElement.appen dChild
( new XSLTProcessor() .transformToFra gment
( 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
4171
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: <xsl:processing-instruction name="php"> echo $hello; </xsl:processing-instruction>
9
1873
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 DocBook chunk stylesheet, but it seems to me that retaining the structural markup of XML formats (i.e., the marking out of salient properties of a text in "anticipation" of RDF "semantics") demands something more powerful than CSS as it is known to...
5
7391
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 store and render web content. Reason being that we are considering migrating our website content to XML and using XSLT to transform the content into html. Currently lack of browser support for XSLT has held us back. For example a significant...
12
3238
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 (xml->html) doen't happen! I have XSLT files for this, they work, I mean when I put the output of the app as an XML file on some server, and make it use the XSLT files to transform into HTML, it works, I get a HTML page.
7
4126
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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:my-javascript-ext="my-ext1" extension-element-prefixes="my-javascript-ext"
4
5251
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 = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); } if (x) {
5
1896
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 controls on that page, before transferring focus to the browser-page and showing it to the user? (the user would be responsible for submitting the page.)
1
3529
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 javascript, nothing really having to do with ASP.NET... I'm attempting to put together an application that consists of several GridView controls each bound to some xml data. Each table exists in its own update panel. The two effects I'm going for are:
6
2495
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 I want is when someone clicks a title chooses the sorting option, if this is the actual sorting option then reverses the order. Can I do this? How?
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10410
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.