Re: [Xsltforms-support] different behaviour for IE and Firefox - position() inside repeat.
Brought to you by:
alain-couthures
From: COUTHURES A. <ala...@ag...> - 2011-01-05 08:23:26
|
Hello Steve, > Specifically the position() XPath function does not work inside an > xf:repeat in FF v3.6 but does work in IE v8.0, thus you see an > incrementing row-number in the first column of the table in the later > but not in the former. > In fact, IE is the wrong one! You should used xf:output/@value instead of xf:output/@ref for rendering XPath expressions which are not also node sets. There is no error message about that but there should be one. > > Also, as you can see there is still a major difference in the relative > performance between IE and FF in this 'paging' table demo using > dataisland branch. Viewing the F1 Xpath evaluation times its clear > that the Xpath for the repeat 'page' nodeset is by far the longest > time (>2500 ms in IE). I tried rewriting this XPath to see if I could > improve this time but without any success. > > Its pretty clear why this should be expensive as its actually testing > each of the 1000 gml:featureMember nodes to see if they match the > predicate, as follows: > > instance('airport')/gml:featureMember[position()>=instance('grid1')/pos > and position()<instance('grid1')/pos+instance('grid1')/stride]/* > > However, changing this to the following (which is not quite correct > logically but potentially better) doesn't improve the time at all: > > instance('airport')/gml:featureMember[position()=instance('grid1')/pos]/following-sibling::*[position()<=instance('grid1')/stride]/* > > The logically correct path would be: > > instance('airport')/gml:featureMember[position()=instance('grid1')/pos]/self::* > | following-sibling::*[position()<instance('grid1')/stride]/* > > I tried looking at the generated XPath 'XXXExpr' functions, to > understand why this might be the case, but so far without any insights. > I'm now designing a commercial version of XSLTForms for performance issues. This implies as many changes such as the ones done for the dataisland branch, first, but will allow to change the general behavior of XSLTForms consisting now in looking at everything if there is something to be done or not. XPath 2.0 partial support can help: in this test case, the "to" operator could be used. There are also possibilities in adding useful extensions. You can already try this experimental extension: add xf:instance/@readonly="true" to each instance with a static content and it will not be validated at loading time. For your test case, the loading time is divided by 2! Unfortunately, a commercial version requires also to work on obfuscating XSLT+JS and on restricting use on a registered domain name. A lot of work implies a lot of time and any kind of support is welcome! Best wishes for 2011 -Alain |