https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2020-03-30T17:15:56ZSaxonica Developer CommunitySaxon - Bug #4506: Poor serialization of XML-format xsl:message outputhttps://saxonica.plan.io/issues/4506?journal_id=151882020-03-30T17:15:56ZMichael Kaymike@saxonica.com
<ul></ul><p>The logic implementing this <code>xsl:message</code> instruction is surprisingly contorted.</p>
<p><code>xsl:message</code> evaluates its select attribute and/or sequence constructor in pull mode, that is by calling iterate(), and then sends the returned items to the target Receiver using the <code>append(item)</code> method.</p>
<p>Because in this case the content of <code>xsl:message</code> is an instruction that likes to be evaluated in push mode, the instruction constructs a tree and then returns its root element node. The message receiver's append() method then decomposes this tree back to a sequence of events that are sent to the message receiver. Since the message receiver is essentially a raw XmlEmitter, there's no logic on this pipeline to eliminate redundant namespace events.</p>
<p>I would think it's almost certainly more straightforward for <code>xsl:message</code> to evaluate its operand in push mode (using the process method) to avoid building the intermediate tree.</p>
<p>But the central problem, I think, is that the events should be pushed to the message emitter via a <code>NamespaceDifferencer</code>, which would handle the namespace deduplication.</p> Saxon - Bug #4506: Poor serialization of XML-format xsl:message outputhttps://saxonica.plan.io/issues/4506?journal_id=151942020-03-31T13:54:21ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Fix Committed on Branch</strong> <i>10</i> added</li></ul><p>Resolved. I have made two changes:</p>
<p>(a) the default <code>MessageFactory</code> used by the <code>XsltController</code> now puts a <code>NamespaceDifferencer</code> in the message output pipeline before the <code>MessageEmitter</code>; this has the effect of eliminating redundant namespace declarations.</p>
<p>(b) the <code>xsl:message</code> instruction now evaluates the message operand in push mode (<code>Expression.process()</code>) rather than pull mode (<code>Expression.iterate()</code>). This is not strictly necessary to fix this bug, but it makes the execution path for <code>xsl:message</code> a lot simpler.</p> Saxon - Bug #4506: Poor serialization of XML-format xsl:message outputhttps://saxonica.plan.io/issues/4506?journal_id=153782020-05-14T15:46:06ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in Maintenance Release</strong> <i>10.1</i> added</li></ul><p>Bug fix committed in the Saxon 10.1 maintenance release.</p> Saxon - Bug #4506: Poor serialization of XML-format xsl:message outputhttps://saxonica.plan.io/issues/4506?journal_id=154162020-05-14T15:50:06ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>