Project

Profile

Help

"No watch found ..." error message with various attempts to use xsl:fork inside of streamed xsl:for-each-group[@group-starting-with]

Added by Martin Honnen over 7 years ago

Using @Saxon-EE 9.8.0.2J@ from the command line, I get an error message "No watch found for ..." with various attempts to convert an XSLT 2.0 @xsl:for-each-group select="*" group-starting-with="h1"@ to streaming, needing a body of @xsl:for-each-group that needs to both process the @current-group()@ as well as check the non-existance of more than one item in the group.

As some bugs related to streamed grouping have been resolved after 9.8.0.2 I file this here in the forum and not as a bug so that you can check whether the latest fixes fix this problem as well.

Here is one example:





	

	

	
	

	
		
			
				
					
						
							
								
									
								
								
									
										
									
								
							
						
					
					
						
					
				
			
		
	


When run against the input




	

<title>Name1</title>

<title>Name2</title>

Test1 Test2

<title>Name3</title>

Test3 Test4

Saxon outputs

Error on line 4 column 10 of test2017062601.xml:
  No watch found for current-group()[2]

When I switch off streaming by setting the static parameter @STREAMABLE=0@ I get the correct, wanted result:




   
      

<title>Name1</title>

<title>Name2</title>

Test1 Test2

<title>Name3</title>

Test3 Test4

I have tried various variations of the @xsl:fork@, but all lead to similar error messages, like


							
								
									
								
								
									
										
									
								
							

giving "No watch found for fn:subsequence(...)" or like


							
								
									
								
								
									
										
									
								
							

giving "No watch found for tail(current-group())".

The only approach that worked is not using @xsl:fork@ but instead use a @copy-of(current-group())@ with a variable


						
							
							
							
								
							
						

Replies (2)

RE: "No watch found ..." error message with various attempts to use xsl:fork inside of streamed xsl:for-each-group[@group-starting-with] - Added by Michael Kay over 7 years ago

Logged as bug #3313.

I found a patch that seems to work, but before I apply it, I'm going to try and discover why it works...

RE: "No watch found ..." error message with various attempts to use xsl:fork inside of streamed xsl:for-each-group[@group-starting-with] - Added by Michael Kay over 7 years ago

The actual condition is

posture.isIncremental() && !forGrouping

and I have established that there are no other tests where posture.isIncremental() is true and forGrouping is also true, so the change seems safe enough. But why the condition was there in the first place eludes me. The code was present in 9.6, and streamed grouping has come on a long way since then, so I think it's just a left-over that's no longer appropriate.

    (1-2/2)

    Please register to reply