Problem with stylesheet performing grouping and outputting text

Problem with stylesheet performing grouping and outputting text

Аватар пользователя martin_honnen

I have the following XML input document:

    1
    2
    3
    4
    
        5
        6
    
    
        7
        8
    

The task is to flatten the data in descendants of the 'data' element to a plain text file so that each value of a descendant element of a certain element name is combined with each value of the elements of a different name.

To solve that I wrote the following stylesheet that first groups the data with for-each-group and then processes those groups with a recursive named template:

  
  
  
  
  

  
    
      
        
          
            
          
          
            
              
            
          
        
      
    
  
  
  
    
    
    
      
        
        
      
      
        
          
            
            
          
        
      
    
  
  
  
    
    
    
      
    
  

When I run that stylesheet with Saxon 9 or AltovaXML tools 2010 I get the output I want, namely

val_A,val_B,val_C,val_D,val_E,val_F
1,3,,5,,7
1,3,,5,,8
1,3,,6,,7
1,3,,6,,8
1,4,,5,,7
1,4,,5,,8
1,4,,6,,7
1,4,,6,,8
2,3,,5,,7
2,3,,5,,8
2,3,,6,,7
2,3,,6,,8
2,4,,5,,7
2,4,,5,,8
2,4,,6,,7
2,4,,6,,8

When I run the stylesheet with Intel's XSLT 2.0 processor I get a completely different result:

val_D,val_D,val_B,val_F,val_A,val_F,val_A,val_C,val_E,val_B
1,2,3,4,,5,6,,7,8

That seems to be a bug with Intel's processor.

3 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя martin_honnen

If I change the stylesheet to group not on the QName returned by the node-name function but simply by the string returned by the local-name function, resulting in the stylesheet

  
  
  
  
  

  
    
      
        
          
            
          
          
            
              
            
          
        
      
    
  
  
  
    
    
    
      
        
        
      
      
        
          
            
            
          
        
      
    
  
  
  
    
    
    
      
    
  

the result with Intel's XSLT processor is much better:

val_F,val_C,val_A,val_B,val_E,val_D
1,3,,5,,7
1,3,,5,,8
1,3,,6,,7
1,3,,6,,8
1,4,,5,,7
1,4,,5,,8
1,4,,6,,7
1,4,,6,,8
2,3,,5,,7
2,3,,5,,8
2,3,,6,,7
2,3,,6,,8
2,4,,5,,7
2,4,,5,,8
2,4,,6,,7
2,4,,6,,8

as all the data is output correctly (meaning the recursive named template works fine), only the first line with the elements names has those names in the wrong order.

So the problem with the original stylesheet seems the group-by="node-name(.)", it seems to be completely broken to use a QName as the grouping key.

Аватар пользователя Russell Davoli (Intel)

Hi Martin,

Thank you for posting this bug report and the follow up note. I will also look into this issue and report back on this thread.

Thanks,

Russell

Зарегистрируйтесь, чтобы оставить комментарий.