Project

Profile

Help

Feature #4065

closed

Saxon-JS: Allow AVTs in ixsl:schedule-action/wait

Added by Gerrit Imsieke over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT export
Sprint/Milestone:
-
Start date:
2018-12-11
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I’m currently experimenting with visualizing a transformation using Saxon-JS. To this end, I injected code into an existing transformation that calls, by means of ixsl:schedule-action, a template that will attach classes to preformatted renderings of the source and of the result document. Portions of the source document and of the result tree are supposed to change their background colours as the transformation proceeds. This works sufficiently well already, but I want to be able to animate, for example, individual current-group()s in an xsl:for-each-group, one at a time. It is therefore desirable to be able to use attribute value templates for @wait. I already experimented with calculated values by modifying the SEF.

This seems to work:

  <let line="162" var="vv:v0" as="xs:integer" slot="3" eval="13">
   <arith op="*" calc="i*i">
    <varRef name="pos1" slot="1"/>
    <int val="4000"/>
   </arith>
   <forEachGroup line="153" algorithm="ending">
  ……
  <ifCall line="163" name="Q{http://saxonica.com/ns/interactiveXSLT}schedule-action" type="item()*">
   <arith op="+" calc="i+i">
      <varRef name="vv:v0" slot="3"/>
      <arith op="*" calc="i*i">
       <varRef name="pos2" slot="4"/>
       <int val="1000"/>
      </arith>
     </arith>
   <empty/>
   <callT line="164" name="add-highlights" bSlot="1">
    <withParam name="Q{}highlights" flags="c" as="map(xs:string, xs:string+)">
   ……
  </let>

stemming from

  <ixsl:schedule-action wait="{$pos1 * 4000 + $pos2 * 1000}">
  <xsl:call-template name="add-highlights">
    <xsl:with-param name="highlights"
      select="map{concat('grouping-population', string($pos1), '_', string($pos2)): $population2}"/>

(the XSLT code doesn’t contain AVTs right now, but this is how I’d use it).

After adapting the checksum, the animation unfolds as scheduled. Therefore I ask whether you are inclined to allow/process/export AVTs on ixsl:schedule-action/@wait in the next release of Saxon-JS.

Ah, did I mention that I’d need it before XML Prague? Anyway, if it’s not feasible or prioritized, I will continue to manually patch the resulting SEF for the demo.

Please register to edit this issue

Also available in: Atom PDF