bug with position() and last() in 'use' attribute of 'xsl:key'

bug with position() and last() in 'use' attribute of 'xsl:key'

This bug report is about using the functions position() and last() in the 'use' attribute of an 'xsl:key' element.

In the XSLT 2.0 specification in http://www.w3.org/TR/xslt20/#keys in the section starting with "The result of the key function can be described" it is said that the key specifier (i.e. the expression specified in the 'use' attribute of xsl:key) "is evaluated with a singleton focus". Singleton focus means that the context size is always 1 which means both the position() and the last() call in a 'use' expression should always return 1.

That however is currently not the case with your XSLT 2.0 processor, when I have input.xml as

  
    1
    2
    3
  

and the stylesheet sheet.xsl as

  
  
  
  
  
  
  
  
  
    
      
      
        
          
          
            
          
        
      
    
  

then the result with your XSLT 2.0 processor is as follows:

<?xml version="1.0" encoding="UTF-8"?>

   
      1
      2
      3
   
   
      
      
      1 2 3
   

which shows that the 'use' expression is not executed with a singleton focus with context size 1 but rather with context size 3 which is a bug.

3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Russell Davoli (Intel)

Hello Martin,

Thank you for posting this bug report. I'm sorry it's taken so long for me to respond;there was a problem with notifications to me for posts to this forum.

I will reproduce the problem and report my findings here.

Thanks,

Russell

Portrait de Russell Davoli (Intel)

Martin,

I have reproduced the bug with our latest build and am logging it in our bug tracking system. We'llinvestigate it, but I don't yet have an estimate on when this will be fixed.

Thanks,

Russell

Connectez-vous pour laisser un commentaire.