error with stylesheet that Saxon and AltovaXML tools run without problems

error with stylesheet that Saxon and AltovaXML tools run without problems

With the XML input and stylesheet below I get the following error with Intel's XSLT 2.0 processor:

XSLT Exception at file ""[line 21]XPST0003: Unknown token: ' ' @:21:0

Saxon 9.2 and AltovaXML tools process the files without reporting an error.

    Lorem ipsum dolor sit ametconsecteturadipisicing elit, 
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
    Ut enim ad minim veniam, quis nostrud exercitation ullamco 
    laboris nisi ut aliquip ex ea commodo consequat. 
    Duis aute iruredolorinreprehenderit in voluptate 
    velit esse cillum doloreeufugiatnullapariatur. Excepteur sint 
    occaecat cupidatat non proident, sunt in culpa qui officia 
    deserunt mollit anim id est laborum.

  
  
  
  
  
    
      
    
  
  
  
    
      
        
          
        
      
      
        
      
    
  
  

  
publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Russell Davoli (Intel)

Hi Martin,

Thanks for reporting this issue. I reproduced the behavior on the public beta version as well as in a recent build.

While investigating, I noticed that there's a variable reference in the select attribute on line 20 with a space between the "$" and the name. For some reason, the error report points to line 21, probably because that's where the xsl:value-of element ends.

I thought the space in the variable reference should not be accepted, so I wassurprised the other processors accepted it. The grammar given in the XPath 2.0 spec describes a VarRef as "$" VarName, and thedescription ofVarName specifies the set of valid characters for the initial name character in a way that does not include a space. So it seems this should be an error.

But then there's a lot of trickiness surrounding the ignorable whitespace rules. It could be the case that the "$ c" falls into a corner case here. I'll look into this.

Thanks,

Russell

Imagen de Russell Davoli (Intel)

Hi Martin,

Further careful reading of the XPath 2.0 specification convinces me that a space in the variable reference (like "$ c" in your stylesheet above) is actually ignorable whitespace that should be, well, ignored. Ignorable whitespace can occur between any terminals in an expression. I was convinced at first that the "$" symbol was not a terminal, but the spec defines terminals roughly as any literal symbol or string that appears on the right hand side ofa grammar production that is not otherwise noted with special whitespace handling. So interestingly enough, a comment can appear here as well, like "$(:Wacky place for a comment!:)c".

I will report thisissuein our bug tracking system for the development team.

Thanks,

Russell

Inicie sesión para dejar un comentario.