xsl-list
[Top] [All Lists]

Re: RE: [xsl] client-side ajax & xslt

2007-03-09 09:36:00

- the user can then update the display any number of times with a minimum amount of network traffic (the browser cache will cache the data and the xslt).

It will cache the *file* if the user's browser is set to do so. A better approach is to cache the browser specific processor object (created from the file->DOM).


now, i do know that ajax frameworks such as sarissa or even better freja are supposed to support this kind of functionality, but they are poorly documented, under constant development, and seem to routinely break with every minor version of a browser. so i have two questions:

- did anybody have success implementing the above scenario, and if so, which framework did you use and on which browsers did you test it? and would you recommend to do it in the same way you did it?

Yes, with dojo and the XslTransform constructor. I would recommend it (but, I wrote it :) ). There are examples in the $DOJO_HOME/tests/xml directory. It is pretty easy, though:

var myXsl = new dojo.xml.XslTransform("path/to/your.xsl");
myXsl.transformToRegion(
                        xmlSourceDom,
                        paramsArray,
                        htmlElementObject,
                        htmlDocumentObject
                        );

It works in IE, FF and Opera. The exception is Opera in that it does not supprt the document function (yet...). So if you don't need the document function, you should be fine in almost all browsers.

But, a general strategy I use is to have a snmallish config XML for the main source of the transform and bring in larger/more XML files through the document function. This way you don't need to build a real DOM and can rely on the XSL processor's optimized DOM (usually a list of SAXish events).



- in general, is there a chance that something like this runs reasonably stable and works for the majority of users? the static strting table should be good enough for those with older browsers, but i want the more flexible solution to be available to the majority of users.

dojo also has a widget that does this type of table, but with JSON data. It is pretty easy to use too.

best,
-Rob


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>