Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4869] iOS: Titanium.XML.Element tagName attribute is returning undefined

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2011-08-04T17:36:40.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-31
ComponentsiOS
Labelsattribute, drillbit, element, tagName, xml
ReporterNatalie Huynh
AssigneeNatalie Huynh
Created2011-08-02T14:24:51.000+0000
Updated2011-08-04T17:43:08.000+0000

Description

Steps to Reproduce: 1. Run drillbit Ti.XML test Actual Result: xmlElement false 942 should be: "dessert", was: "undefined" Expected Result: Should pass

Attachments

FileDateSize
element.xml2011-08-04T14:30:03.000+0000628
elementNS.xml2011-08-04T14:30:03.000+0000748
xml.js2011-08-04T14:30:03.000+000040817

Comments

  1. Blain Hamon 2011-08-04

    Talked with Natalie on this. Turns out the confusion is that, by spec, getElementsByTagName returns a nodelist, not an element ( http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-745549614 ). Nodelist does not have a tagname, only length and items ( http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-536297177 ). The test, as such, should check for the tagName of an item within the nodelist results of getElementsByTagName.
  2. Blain Hamon 2011-08-04

    Turns out that the test was looking at the wrong object of the wrong type, which does not nor should not have a tagName attribute.
  3. Natalie Huynh 2011-08-04

    Works when calling valueOf(elements.item(0).tagName).shouldBe("dessert")

JSON Source