Project

Profile

Help

Bug #3515

closed

[Saxon 9.8] Internal error when executing a .sef file compiled with -relocate:on

Added by Axel Court about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Low
Category:
-
Sprint/Milestone:
Start date:
2017-11-07
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.8, trunk
Fix Committed on Branch:
9.8, trunk
Fixed in Maintenance Release:
Platforms:

Description

Hi,

We are getting an internal error when trying to run a stylesheet .sef stylesheet compiled with Saxon 9.8.0.6 and the -relocate:on option. See the stacktrace below:

java.lang.RuntimeException: Internal error evaluating template rule 
	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:360)
	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:502)
	at net.sf.saxon.Controller.transformDocument(Controller.java:2402)
	at net.sf.saxon.Controller.transform(Controller.java:1970)
	at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:593)
	at net.sf.saxon.Transform.processFile(Transform.java:1257)
	at net.sf.saxon.Transform.doTransform(Transform.java:780)
	at net.sf.saxon.Transform.main(Transform.java:81)
Caused by: java.lang.NullPointerException
	at java.util.Hashtable.put(Unknown Source)
	at java.util.Properties.setProperty(Unknown Source)
	at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:413)
	at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2237)
	at com.saxonica.config.EnterpriseConfiguration.processResultDocument(EnterpriseConfiguration.java:1895)
	at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:387)
	at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:373)
	at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:880)
	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:347)
	... 7 more
Fatal error during transformation: java.lang.RuntimeException: Internal error evaluating template rule 

I attached a .zip file so you can reproduce the error.

The two command lines we are using are in the .bat file.

If -relocate option is set to "on", the .sef is created but its execution fails.

If it is set to "off", the execution works fine.

Basically, the stylesheet does a result-document under certain circumstances. The @href is computed from the parameters $outputDirPath and $input-name. Whether $outputDirPath is a relative URI ("." in the example) or an absolute one (ex.: "file:/C:/path/to/dir") does not prevent the execution from failing.

There is also a third commented command line in the .bat, which exports the .sef and does the transformation "at the same time". This works fine even with the ~~relocate:on option ~~ but I guess it's not the .sef file that is indeed used for the execution phase.

Thank you for your time investigating this.

Regards,

Axel

Actions #1

Updated by Michael Kay about 7 years ago

  • Assignee set to Debbie Lockett
Actions #2

Updated by Debbie Lockett about 7 years ago

  • File deleted (_TC.zip)
Actions #3

Updated by Debbie Lockett about 7 years ago

  • Status changed from New to In Progress

Thanks for reporting the problem. I can reproduce the issue with the code provided (but I have now removed the zip to protect private information). I will investigate further.

Actions #4

Updated by Debbie Lockett about 7 years ago

  • Status changed from In Progress to Resolved
  • Applies to branch 9.8, trunk added
  • Fix Committed on Branch 9.8, trunk added

The problem arises inside ResultDocument.processInstruction() when the property SaxonOutputKeys.PARAMETER_DOCUMENT_BASE_URI is set to be getStaticBaseURIString(), but this is null (as in this case when we are running an SEF produced with -relocate:on). The property should only be set when getStaticBaseURIString() is not null.

Note that in the SerializerFactory, we already handle the case that SaxonOutputKeys.PARAMETER_DOCUMENT_BASE_URI is null.

Fix committed on the 9.8 and trunk branches.

Actions #5

Updated by O'Neil Delpratt about 7 years ago

  • % Done changed from 0 to 100

Bug fix applied in the Saxon 9.8.0.7 maintenance release.

Actions #6

Updated by O'Neil Delpratt about 7 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.8.0.7 added

Please register to edit this issue

Also available in: Atom PDF