Project

Profile

Help

match="schema-element(bar:bar-head)" of imported or included stylesheet not matching

Added by Martin Honnen over 6 years ago

I have a question on a behaviour of Saxon 9.8.0.6 EE using a schema-aware transformation where the main stylesheet imports or includes a second one that uses @match="schema-element(bar:bar-head)"@, Saxon does not use this template of the imported or included stylesheet. However, when I textually add the rule to the stylesheet, it is matched.

It appears to me that the template rule should also match for the imported or included stylesheet as it should have higher priority than the built-in rules.

Here is a reduced test case, the main stylesheet is




	
	
	
	
	
	
	
	
		
	
	

the imported stylesheet has





	
	
	
		
	
	

a sample input document is




	Line 1.Line 2.Line 3.
	Line 1.Line 2.Line 3.

and the main schema is




	
	

	
		
	

	
		
			
				
					
						
							
							
						
					
				
			
		
	

	

	

the second schema is




	
	
		
	


When I run that main stylesheet with Saxon 9.8 EE from the command line with options @-sa -val:strict !indent=yes@ I get the output




   Line 1.Line 2.Line 3.
   Line 1.Line 2.Line 3.

while a stylesheet having the rule imported above textually




	
	
	
	
	

	
		
	
	
	
		
	
	

gives me the expected output




   Line 1.Line 2.Line 3.
   Line 1.Line 2.Line 3.

Shouldn't the stylesheet doing the import also produce the output shown last?


Replies (1)

RE: match="schema-element(bar:bar-head)" of imported or included stylesheet not matching - Added by Michael Kay over 6 years ago

This might turn out to be the same problem (or at least in the same area) as bug #3531, which is basically a problem of substitution groups not being merged when two schemas are loaded independently, rather than one importing the other. If it is, then that's a good thing, because the schema used in bug #3531 contains thousands of components all over the web, and is a nightmare to debug.

    (1-1/1)

    Please register to reply