Project

Profile

Help

Bug #3335

closed

Lazy evaluation of sequence constructors - instructions with side effects evaluated early

Added by Pieter Masereeuw almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2017-07-04
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
1.0
Fix Committed on JS Branch:
1.0
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Hi,

I have a problem with Saxon-JS. It seems to be related with either some optimization or, more likely, with concurrency.

I have a template that calls a named template "deactivate" (it modifies the current page sothat it looks disabled).

After that, it schedules an action for loading an external document (ixsl:schedule-action). The scheduled action is a named template that renders the document (<xsl:apply-templates select="doc(someurl)">). After rendering the document, it calls a named template "reactivate", which undoes the work of the earlier "deactivate".

I added a lot of xsl:messages, and in the console of Chrome, I see that template "reactivate" is sometimes called earlier than "deactivate". This seems to be especially the case when the doc() function has been passed a URL that it has seen before (so XSLT need not physically reload the document).

The "deactivate" template has the following structure:

  • xsl:message "started"

  • xsl:for-each:

    -- message "inside for-each"

  • xsl:message "completed"

Looking at the output in the Chrome console, the messages of the for-each show up at a strange moment, for example when the "completed" message of the entire template has already been printed.

I do recognize the fact that I may be doing things wrong, but I hope that you can shed some light on this. And if it does appear to be a bug, I think you want to know.

Now the application is relatively complex (and written in a mixture of Dutch, English and even a small amount of PHP), so if you are willing to investigate, perhaps I can give some instructions on how to reproduce the problem or even share my screen - I will be most happy to offer any help that is needed. Also, if I need to attempt to reduce the size of the application, let me know.

The behaviour is also seen in Firefox, but in my Firefox, xsl:messages are not shown in the console.

I attach the files plus a screen selection of the Chrome console. The numbers indicate, more or less, the expected order of messages.

Kind regards,

Pieter Masereeuw


Files

chrome-console-log.png (99 KB) chrome-console-log.png Screen print selection of Chrome console Pieter Masereeuw, 2017-07-04 18:14
target.zip (1.1 MB) target.zip The application (refer to folder gtb) Pieter Masereeuw, 2017-07-04 18:14
doctest.zip (247 KB) doctest.zip Pieter Masereeuw, 2017-07-05 08:58

Please register to edit this issue

Also available in: Atom PDF Tracking page