Bug #3386

deep-equal() fails comparing attributes

Added by Michael Kay almost 2 years ago. Updated over 1 year ago.

Start date:
Due date:
% Done:


Applies to JS Branch:
0.9, 1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Contact person:
Additional contact persons:


A number of tests for deep-equals(), e,g, expression-1401, fail. The methods hasAttributeNS() and getAttributeNS() are being called with a first argument of "" to indicate no-namespace, but it seems that null is correct (though it's hard to find documentation on this).

Fixed on the JS branch.


#1 Updated by Debbie Lockett almost 2 years ago

  • Fix Committed on JS Branch 1.0 added

This change was producing a number of QT3 test failures (e.g. -s:prod-AxisStep.unabbr -t:unabbreviatedSyntax-8).

I believe it is correct that we should use null rather than "" to indicate no-namespace, as this seems to work with what we get back from the XML parser (e.g. DOMParser.parseFromString() as used by parseXmlFromString() in JSTestDriver or NashornPlatform).

The problem is that we are not using this when we set attributes ourselves - i.e. when we use setAttributeNS within makeComplexContent (in Copy.js on trunk branch, Expr.js on 1.0), copyItem (Copy.js on trunk branch, domutils.js on 1.0), and CoreFn.snapshot. If the namespaceURI is "", we should use setAttributeNS(null, name, value) rather than setAttributeNS("", name, value).

Changes committed on the trunk and 1.0 branches.

#2 Updated by Debbie Lockett over 1 year ago

  • Status changed from New to Resolved

Marking as resolved now.

#3 Updated by Debbie Lockett over 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.0.2

Bug fix applied in Saxon-JS 1.0.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page