Project

Profile

Help

Use of xsl:copy-of select="$var" inside xsl:for-each-group group-adjacent of streaming mode leads to "The current-group() function is evaluated repeatedly" message

Added by Martin Honnen almost 9 years ago

Using Saxon 9.7 EE I tried to write a streamed @xsl:for-each-group group-adjacent@ sample as follows:











  
    
  
  
    
      
        
      
    
  



On compiling the stylesheet, I get the message

Error at xsl:template on line 13 column 26 of test201601090306.xsl:
  XTSE3430: Template rule is declared streamable but it does not satisfy the streamability rules.
  * The current-group() function is evaluated repeatedly

I don't see several evaluations of @current-group()@. The demo of Exselt does not complain about the code as not being streamable.

I realize I can write


      
        
      

instead of the



      
        
      

and have tested that alternative to compile and run with Saxon but I wonder why the use of the @xsl:copy-of select="$var"@ causes the error message about repeated evaluation of @current-group()@.

An example input file looks like




   Product 1
   Product 2
   Product 3
   Product 4
   Product 5
   Product 6
   Product 7
   Product 8
   Product 9
   Product 10
   Product 11
   Product 12
   Product 13
   Product 14
   Product 15
   Product 16
   Product 17
   Product 18
   Product 19
   Product 20
   Product 21
   Product 22
   Product 23
   Product 24
   Product 25
   Product 26
   Product 27
   Product 28
   Product 29
   Product 30
   Product 31
   Product 32
   Product 33
   Product 34
   Product 35
   Product 36
   Product 37
   Product 38
   Product 39
   Product 40
   Product 41
   Product 42
   Product 43
   Product 44
   Product 45
   Product 46
   Product 47
   Product 48
   Product 49
   Product 50
   Product 51
   Product 52
   Product 53
   Product 54
   Product 55
   Product 56
   Product 57
   Product 58
   Product 59
   Product 60
   Product 61
   Product 62
   Product 63
   Product 64
   Product 65
   Product 66
   Product 67
   Product 68
   Product 69
   Product 70
   Product 71
   Product 72
   Product 73                  
   Product 74
   Product 75
   Product 76
   Product 77
   Product 78
   Product 79
   Product 80
   Product 81
   Product 82
   Product 83
   Product 84
   Product 85
   Product 86
   Product 87
   Product 88
   Product 89
   Product 90
   Product 91
   Product 92
   Product 93
   Product 94
   Product 95
   Product 96
   Product 97
   Product 98
   Product 99
   Product 100
   Product 101
   Product 102
   Product 103
   Product 104
   Product 105


    (1-3/3)

    Please register to reply