Saxon 9.7 HE and expand-text
Added by Martin Honnen almost 9 years ago
I am experiencing some odd behaviour with Saxon 9.7 HE and the use of the XSLT 3.0 @expand-text@ feature, when I have it in a @version="2.0" stylesheet, like
Product {.}
then I get a warning
The @expand-text attribute is ignored because XSLT 3.0 is not enabled
the result elements look like @Product {.}@, which is fine, given the warning.
However, when I set @version="3.0"@, as in
Product {.}
I don't get any warning, but all product
result elements are empty: @@.
I understand that XSLT 3.0 support is implemented for PE and EE only but I think that HE should then emit a warning and ignore stuff like @expand-text@.
Replies (3)
Please register to reply
RE: Saxon 9.7 HE and expand-text - Added by Michael Kay almost 9 years ago
Sorry for the delay in responding.
I haven't been able to reproduce the problem. I've tried 9.7.0.1, 9.7.0.2, and 9.7.0.3, HE edition downloaded from SourceForge and run from the command line, and in each case I get:
Saxon-HE 9.7.0.1J from Saxonica Java version 1.7.0_55 Warning: at xsl:for-each on line 12 column 57 of test.xsl: The @expand-text attribute is ignored because XSLT 3.0 is not enabled Stylesheet compilation time: 489.179ms Processing (no source document) initial template = main
Product {.} Product {.} Product {.} Product {.} ...as expected.
RE: Saxon 9.7 HE and expand-text - Added by John Olsson over 8 years ago
I have downloaded the latest version of HE (9.7.0.4) and I get this behavior (edited output to remove search paths)
Foo.xsl looks like this
Starting test... A B Ending test...
$ java -jar tools/saxon9he.jar -explain foo.xml -xsl:tools/Foo.xsl Starting test... Ending test... A B $
However, if I set expand-text="yes", i.e.
Starting test... A B Ending test...
I get this
$ java -jar tools/saxon9he.jar -explain foo.xml -xsl:tools/Foo.xsl $
Question: Is there an error in the XSLT, a bug in Saxon, or does Saxon HE 9.7.0.4 not support Text Value Templates (have not found any statement in the documentation regarding if it does or does not support Text Value Templates when expand-text is set to "yes")?
RE: Saxon 9.7 HE and expand-text - Added by Michael Kay over 8 years ago
This certainly looks wrong.
Saxon-HE does not support XSLT 3.0: it runs as an XSLT 2.0 processor. The rules for an XSLT 2.0 processor are that when it sees version="3.0", it should run in forwards compatibility mode. This means it should ignore attributes that have no defined meaning in 2.0, for example expand-text.
Because this is thoroughly unfriendly, Saxon should output a message to say that expand-text is ignored. But you evidence suggests that it isn't actually being ignored, it's causing the whole xsl:text instructions to be ignored.
Will investigate
Please register to reply