Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2393] Drillbit regression: xml.js (Wrong node attribute)

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:58:59.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M10
ComponentsiOS
Labelsdrillbit, ios, regression, release-1.6.0, xml
ReporterStephen Tramer
AssigneeStephen Tramer
Created2011-04-15T03:18:32.000+0000
Updated2011-04-17T01:58:59.000+0000

Description

Test fails xmlNodes:98:

var doc = Ti.XML.parseString(this.testSource["nodes.xml"]);
var nodesList = doc.getElementsByTagName("nodes");
var nodes = nodesList.item(0);
var node = nodes.getElementsByTagName("node").item(0);
var subnodes = node.getElementsByTagName("node");
valueOf(subnodes.item(1).getAttribute("id")).shouldBe("node 2");

Could also be invalid on Android. Going to test and see.

Comments

  1. Stephen Tramer 2011-04-15

    According to the DOM Level 2 spec, this is actually an Android bug:

    http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1938918D">http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1938918D

    In this particular case, it looks like Android returns the 'self' node in the search result set if it matches, which is wrong. iOS does the right thing and returns only elements from its subtree.

    Reassigning to Marshall so he can look at it.

  2. Marshall Culpepper 2011-04-15

    (from [4389dbeacebdf3108256500daeca170cc6c6d6ac]) updated drillbit test to have write DOM API tests, getElementsByTagName now correctly filters the current node if it also matches the query (fixing a bug in the Android Harmony Impl) [#2393 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/4389dbeacebdf3108256500daeca170cc6c6d6ac"> https://github.com/appcelerator/titanium_mobile/commit/4389dbeacebd...

  3. Marshall Culpepper 2011-04-15

    (from [aa683287fe54044577aad83411faaf170eec1960]) updated drillbit test to have write DOM API tests, getElementsByTagName now correctly filters the current node if it also matches the query (fixing a bug in the Android Harmony Impl) [#2393 state:fixed-in-qa] https://github.com/appcelerator/titanium_mobile/commit/aa683287fe54044577aad83411faaf170eec1960"> https://github.com/appcelerator/titanium_mobile/commit/aa683287fe54...

JSON Source