https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2021-03-15T14:57:13ZSaxonica Developer CommunitySaxon - Bug #4937: Extra NS declaration added by transformerhttps://saxonica.plan.io/issues/4937?journal_id=175322021-03-15T14:57:13ZMichael Kaymike@saxonica.com
<ul><li><strong>Category</strong> set to <i>DOM Interface</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><li><strong>Applies to branch</strong> <i>trunk</i> added</li></ul><p>Thanks for reporting it.</p>
<p>Reproduced as JUnit test testNamespaceSerializationBug4937().</p> Saxon - Bug #4937: Extra NS declaration added by transformerhttps://saxonica.plan.io/issues/4937?journal_id=175332021-03-15T15:34:19ZMichael Kaymike@saxonica.com
<ul></ul><p>The error appears to be when combining two namespace maps (<code>NamespaceMap.applyDifferences()</code> -- which is not actually DOM-specific code, though it's probably used rather differently when handling DOM input.). This ends up incorrectly generating an empty namespace map for element b, rather than a map containing the single namespace binding (""=""). This error is then compounded: because the namespace map is empty, the scan of attributes on element b doesn't check whether any of the attributes are actually namespaces, so it's processing xmlns:"" a second time as if it were an ordinary attribute.</p> Saxon - Bug #4937: Extra NS declaration added by transformerhttps://saxonica.plan.io/issues/4937?journal_id=175342021-03-15T15:40:13ZMichael Kaymike@saxonica.com
<ul></ul><p>I've applied a fix to <code>NamespaceMap.applyDifferences()</code> on the 10.x branch which ensures this test now passes. However, the test passes on the 11.x branch without this change: I'm currently exploring why.</p> Saxon - Bug #4937: Extra NS declaration added by transformerhttps://saxonica.plan.io/issues/4937?journal_id=175352021-03-15T15:44:55ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>Fix Committed on Branch</strong> <i>10, trunk</i> added</li></ul><p>It was working on the 11.x branch because my configuration settings meant I was picking up Xalan as the DOM identityTransformer. Fixed this, found the bug was still present, so I've applied the patch to both branches.</p> Saxon - Bug #4937: Extra NS declaration added by transformerhttps://saxonica.plan.io/issues/4937?journal_id=178362021-04-14T15:50:04ZO'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.5</i> added</li></ul><p>Bug fix applied to Saxon 10.5 maintenance release.</p>