https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2018-10-02T12:13:13ZSaxonica Developer CommunitySaxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=123192018-10-02T12:13:13ZMichael Kaymike@saxonica.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/12319/diff?detail_id=17284">diff</a>)</li></ul> Saxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=123202018-10-02T13:49:19ZMichael Kaymike@saxonica.com
<ul></ul><p>The main issue here seems to be that we don't have any streamability analysis code for xsl:message, and it is falling back to the default. (But I'm not sure why this doesn't give a streamability failure).</p>
<p>A secondary issue is that we aren't being smart about inferring the context item type for the match pattern <code>match=".[. instance of ....]"</code>. There's justification for this, because the W3C spec doesn't handle it specially. But we could do better.</p> Saxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=123212018-10-02T15:27:27ZMichael Kaymike@saxonica.com
<ul></ul><p>The streamability rules in 1.b.iii.A.I say</p>
<p>If U is absorption and the intersection of T with U{element(), document-node()} is U{} (that is, if T is a type that does not allow nodes with children), then U′ is inspection.</p>
<p>But (Streamability line 169) we are actually testing isChildlessNodeKind(), which returns false for items such as maps and atomic values.</p>
<p>This has the effect that even when we compute the context item type for this template rule as map(*), the reference to "." in xsl:message, which has usage absorbtion, is considered to be a "potentially consuming operand", leading to the select expression of the xsl:message instruction being classified striding and motionless. This in turn leads to the xsl:message being classified as grounded and consuming. Which in this case isn't fatal, but if there were more than one xsl:message instruction like this then we would get a "multiple consuming operands" streamability failure.</p>
<p>I've changed the test from <code> isChildlessNodeKind()</code> to <code>!t.getUType().overlaps(UType.DOCUMENT.union(UType.ELEMENT))</code> and unfortunately this doesn't solve the problem. The arguments to xsl:message include both "." and various variables whose type can include element nodes, so the test that the value can't be an element or document node isn't satisfied anyway.</p>
<p>I can't help feeling there's a rule missing here somewhere: if the match pattern on a template rule doesn't match nodes, then the template rule must surely be grounded and motionless, regardless of its contents.</p> Saxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=123232018-10-02T16:16:39ZMichael Kaymike@saxonica.com
<ul><li><strong>Fix Committed on Branch</strong> <i>9.9</i> added</li></ul><p>The two changes reported above cause no test regression so I have committed them (for 9.9 only), even though they do not solve this test case:</p>
<p>(a) align the general streamability rules implementation with the spec</p>
<p>(b) infer the context item type from a match pattern such as <code>match=".[. instance of X]"</code></p> Saxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=123932018-10-08T15:48:58ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul><p>I have made a couple of changes to enable this test case to pass:</p>
<ul>
<li>
<p>When the item type of a match pattern does not allow nodes, assess the template body with a context item posture of GROUNDED. This rule isn't in the spec (perhaps because the rules in the spec for assessing the item type of match patterns aren't actually good enough) -- but it seems to make sense; it ensures that references to "." within the body of the template will be treated as grounded.</p>
</li>
<li>
<p>When the context item type does not allow nodes, assess the streamability of the context item expression "." as grounded and motionless.</p>
</li>
</ul>
<p>Adding these rules causes no test regression, though it does arguably mean that we are no longer applying the W3C streamability rules as strictly as we should.</p>
<p>There are other issues raised by the test that should probably be handled with new tests and new issues, notably the streamability and streaming of xsl:message and xsl;assert.</p> Saxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=123942018-10-08T16:05:31ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul><p>Fixed on the 9.9 branch.</p>
<p>Not making these changes for 9.8, in the interests of stability.</p> Saxon - Bug #3934: Streamability analysis problem SXST0060https://saxonica.plan.io/issues/3934?journal_id=126442018-11-07T18:18:05ZO'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>9.9.0.2</i> added</li></ul><p>Bug fix applied to the Saxon 9.9.0.2 maintenance release.</p>