https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2021-05-12T14:34:00ZSaxonica Developer CommunitySaxon - Bug #4985: NullPointerException in Saxon-EE while compiling invalid stylesheethttps://saxonica.plan.io/issues/4985?journal_id=179562021-05-12T14:34:00ZMichael Kaymike@saxonica.com
<ul></ul><p>The stylesheet should report errors (assuming you're not running with <code>target:JS</code>), because it calls constructs that aren't available in Saxon/J, such as <code>ixsl:schedule-action</code> and <code>xsl:query-params()</code>. But of course it shouldn't fail with an NPE.</p>
<p>I think the reason it's crashing is that it's a bit inconsistent as to whether the children of ixsl:schedule-action are treated as instructions or not.</p>
<p>The relevant rule for the <code>xsl:schedule-action</code> element is:</p>
<blockquote>
<p>[ERR XTDE1450] When a processor performs fallback for an extension instruction that is not recognized, if the instruction element has one or more xsl:fallback children, then the content of each of the xsl:fallback children must be evaluated; it is a dynamic error if it has no xsl:fallback children.</p>
</blockquote>
<p>But in fact we won't get that far: the instruction will never be evaluated because the stylesheet contains errors (the call on ``xsl:query-params()`).</p>
<p>If we had no knowledge at all of the <code>xsl:schedule-action</code> instruction, then I think it's an open question whether we should validate the contained <code>xsl:call-template</code>: I don't think the spec answers this question. But the crash occurs because we are doing half the work of validating it, and not the other half. Given that we do have knowledge of the instruction, I think it makes sense to validate the contained instruction fully.</p> Saxon - Bug #4985: NullPointerException in Saxon-EE while compiling invalid stylesheethttps://saxonica.plan.io/issues/4985?journal_id=179572021-05-12T15:14:54ZMichael Kaymike@saxonica.com
<ul><li><strong>Category</strong> set to <i>XSLT conformance</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Assignee</strong> set to <i>Michael Kay</i></li><li><strong>Priority</strong> changed from <i>Low</i> to <i>Normal</i></li></ul><p>For reasons which I don't understand, the error in the text-value-template at line 41 (specifically, the call on ixsl:query-params) is causing the <code>prepare-attributes</code> phase of processing on template main to be abandoned, meaning that when the <code>validate</code> phase is subsequently run, the call-template instruction is processed in <code>validate</code> mode without first having been processed in <code>prepare-attributes</code> mode.</p> Saxon - Bug #4985: NullPointerException in Saxon-EE while compiling invalid stylesheethttps://saxonica.plan.io/issues/4985?journal_id=179582021-05-12T15:53:42ZMichael Kaymike@saxonica.com
<ul></ul><p>The solution is for <code>TextValueTemplateNode.parse()</code> to catch any error thrown by the call on <code>AttributeValueTemplate.make()</code>, and report it via <code>StyleElement.compileError()</code>, rather than letting it bubble upwards causing the processing of the containing component to be abandoned.</p> Saxon - Bug #4985: NullPointerException in Saxon-EE while compiling invalid stylesheethttps://saxonica.plan.io/issues/4985?journal_id=179592021-05-12T16:05:23ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>Applies to branch</strong> <i>trunk</i> added</li><li><strong>Fix Committed on Branch</strong> <i>10, trunk</i> added</li></ul> Saxon - Bug #4985: NullPointerException in Saxon-EE while compiling invalid stylesheethttps://saxonica.plan.io/issues/4985?journal_id=184722021-09-16T13:59:48ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in Maintenance Release</strong> <i>10.6</i> added</li></ul><p>Bug fix applied in the Saxon 10.6 maintenance release</p> Saxon - Bug #4985: NullPointerException in Saxon-EE while compiling invalid stylesheethttps://saxonica.plan.io/issues/4985?journal_id=185182021-09-16T14:09:37ZMichael Kaymike@saxonica.com
<ul><li><strong>Subject</strong> changed from <i>NullPointerException in Saxon-EE</i> to <i>NullPointerException in Saxon-EE while compiling invalid stylesheet</i></li></ul>