Project

Profile

Help

Should Saxon 9.7 HE with a version="3.0" stylesheet run in forwards compatible mode and ignore e.g. xsl:mode?

Added by Martin Honnen over 6 years ago

When I run Saxon 9.7.0.20 from the command line against an XSLT 3.0 stylesheet like




	
	
	
	
	
	
		
			
				<title>Upated to XSLT 3 and Saxon 9.8</title>
			
			
		
	  
	

I would have expected that it runs in forwards compatible mode and ignores the XSLT 3 @xsl:mode@ top-level element.

However, it reports three errors:

Static error at xsl:mode on line 10 column 40 of test2017111301.xsl:
  XTSE0010: Element xsl:mode must not appear directly within xsl:stylesheet
Static error at xsl:mode on line 10 column 40 of test2017111301.xsl:
  XTSE0010: Element xsl:mode must not appear directly within xsl:stylesheet
Static error at xsl:mode on line 10 column 40 of test2017111301.xsl:
  XTSE0010: Unknown XSLT element: mode

For what's worth, XmlPrime does ignore the @xsl:mode@.

Shouldn't Saxon 9.7 HE also do that?


Replies (1)

RE: Should Saxon 9.7 HE with a version="3.0" stylesheet run in forwards compatible mode and ignore e.g. xsl:mode? - Added by Michael Kay over 6 years ago

The 9.7 documentation (conformance/XSLT2.0) says:

When Saxon is run as an XSLT 2.0 processor, and the stylesheet specifies version="3.0", the XSLT 2.0 rules for running in forwards compatibility mode are not followed blindly. A strict interpretation of the rules would require that an attribute such as tunnel="true" is silently ignored with no error (because "true" is a value not recognized in XSLT 2.0); instead, Saxon will generally give a warning and adopt the 3.0 interpretation of the attribute.

It was partly the difficulty of getting this kind of thing right that made us decide in 9.8 to drop the attempt to provide 2.0 conformance alongside 3.0 conformance.

The intent of forwards compatibility mode is to define how a processor should handle unknown features, features defined in a specification that did not exist at the time the product was released. Treating features in a published future release in the same way doesn't really make much sense.

    (1-1/1)

    Please register to reply