Project

Profile

Help

Problem with text value templates (SaxonHE9-6-0-1J)

Added by Jan Pour about 10 years ago

Hi, I was trying the example from spec: XSL Transformations (XSLT) Version 3.0 - W3C Last Call Working Draft 2 October 2014, chapter: 5.7.2 Text Value Templates. I used this stylesheet:




	
	
		
		
  {$x + $y}

	
		
			
		
	


But I got this message from running on the command line: XTTE0780: An empty sequence is not allowed as the result of function f:sum()

And more info when running from ANT:


Fatal Error! An empty sequence is not allowed as the result of function f:sum()
...
javax.xml.transform.TransformerConfigurationException: net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported
        at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:155)
        at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
        at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
        at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
        at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:850)
        at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:388)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: net.sf.saxon.s9api.SaxonApiException: Stylesheet compilation failed: 1 error reported
        at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:546)
        at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:152)
        ... 22 more
Caused by: net.sf.saxon.trans.XPathException: Stylesheet compilation failed: 1 error reported
        at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:97)
        at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
        ... 23 more

I use: java version "1.7.0_55" Java(TM) SE Runtime Environment (build 1.7.0_55-b14) Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing) Hope it helps. Thanks. Jan


Replies (1)

RE: Problem with text value templates (SaxonHE9-6-0-1J) - Added by Michael Kay about 10 years ago

I think you are running Saxon-HE, which does not support XSLT 3.0. Your example works correctly under Saxon-EE, with -xsltversion:3.0. It's also working correctly (i.e. failing correctly) under Saxon-EE with -xsltversion:2.0.

That leaves the question, why the curious error message under Saxon-HE? It seems that the text vaue template is half-recognized, and then ignored. The code that looks for the "expand-text" attribute is present in Saxon-HE, and it takes it down a path trying to compile the text value template, but the code for compiling text value templates is absent from Saxon-HE, so it compiles it to an empty sequence.

We'll treat this as a bug; but the primary problem is that you're trying to use XSLT 3.0 constructs under Saxon-HE, which won't work.

    (1-1/1)

    Please register to reply