https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2017-02-28T17:40:59ZSaxonica Developer CommunitySaxonJS - Bug #3149: Constructed element node lacks xmlns="" undeclarationhttps://saxonica.plan.io/issues/3149?journal_id=80262017-02-28T17:40:59ZMichael Kaymike@saxonica.com
<ul></ul><p>Provisionally fixed in DomUtils.copyItem by expanding the relevant code that recursively copies and attaches child elements to read:</p>
<pre><code> Axis.child(item).forEachItem(function (child) {
var newChild = DomUtils.copyItem(child, context, flags);
if (newChild.nodeType == DomUtils.ELEMENT_NODE &&
DomUtils.nameOfNode(newChild).uri == "" && nodeName.uri != "") {
DomUtils.declareNS(newChild, "", "");
}
newNode.appendChild(newChild);
});
</code></pre> SaxonJS - Bug #3149: Constructed element node lacks xmlns="" undeclarationhttps://saxonica.plan.io/issues/3149?journal_id=80272017-02-28T17:48:51ZMichael Kaymike@saxonica.com
<ul></ul><p>Unfortunately this change causes regression in other test cases, e.g. namespace-2201, wherein it adds an xmlns="" undeclaration where it shouldn't.</p> SaxonJS - Bug #3149: Constructed element node lacks xmlns="" undeclarationhttps://saxonica.plan.io/issues/3149?journal_id=80282017-02-28T17:57:25ZMichael Kaymike@saxonica.com
<ul></ul><p>namespace-2201 was working because two bugs cancelled each other out.</p>
<p>There is a separate bug whereby xsl:element with a name attribute that is an unprefixed NCName, and no namespace attribute, creates an element in no namespace, not in the namespace defined by a containing default namespace declaration in the stylesheet.</p> SaxonJS - Bug #3149: Constructed element node lacks xmlns="" undeclarationhttps://saxonica.plan.io/issues/3149?journal_id=94092017-07-05T14:10:41ZDebbie Lockettdebbie@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li></ul><p>I'm not quite sure where we got to with this bug a couple of months ago. I have not seen failures for namespace-2201, but I did have a number of new failures in the namespace test set, following code changes around this time.</p>
<p>On 09/03/2017 the way the result of a test was handled by our test driver was changed - to use the serialized form: Expr.serialize(Iter.Singleton(options.principalResult))</p>
<p>However the serializer dropped namespace undeclarations. This has now been fixed (by adding the domutils.hasNamespaceUndeclaration method, and using this in the domutils.xmlToString method).</p>
<p>I have also made a change within Expr.makeComplexContent append to correctly add namespace undeclarations to the child before appending to the parent.</p>
<p>I believe this fixes the bugs: all -s:element tests now pass, and all but 3 -s:namespace tests pass.</p> SaxonJS - Bug #3149: Constructed element node lacks xmlns="" undeclarationhttps://saxonica.plan.io/issues/3149?journal_id=97852017-08-10T10:47:08ZDebbie Lockettdebbie@saxonica.com
<ul><li><strong>Applies to JS Branch</strong> <i>1.0</i> added</li><li><strong>Fix Committed on JS Branch</strong> <i>1.0</i> added</li></ul> SaxonJS - Bug #3149: Constructed element node lacks xmlns="" undeclarationhttps://saxonica.plan.io/issues/3149?journal_id=98112017-08-10T11:24:30ZDebbie Lockettdebbie@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 JS Release</strong> set to <i>Saxon-JS 1.0.1</i></li></ul><p>Bug fix applied in Saxon-JS 1.0.1 maintenance release.</p>