Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1624] iOS: TiDOMNode nextSibling, previousSibling properties skip non-element nodes

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-06-25T13:22:23.000+0000
Affected Version/sn/a
Fix Version/sRelease 2.1.0
ComponentsiOS
Labelsapi
ReporterBrion Vibber
AssigneeNeeraj Gupta
Created2011-04-15T02:57:41.000+0000
Updated2017-03-07T18:28:28.000+0000

Description

The nextSibling and previousSibling properties on a DOM node are supposed to return whatever the next node is, and iterating along them should always give the same results as iterating over the parent node's children property nodelist.

However, they have been implemented on iOS by calling libxml2's xmlNextElementSibling and xmlPreviousElementSibling functions, which skip over non-element nodes.

This can lead to interesting failures trying to iterate through a mixed element/text/cdata set, and causes big red error screens on the 'XML DOM' demo in KitchenSink when the 'nodewalker' test functions do exactly that.

Comments

  1. Brion Vibber 2011-04-15

    Fix in my work fork:

    http://github.com/brion/titanium_mobile/commits/ios-xml-sibling">http://github.com/brion/titanium_mobile/commits/ios-xml-sibling
    http://github.com/brion/titanium_mobile/commit/bb47e741a7a25b0a66eb1a8c51bbdb9432c4430b"> http://github.com/brion/titanium_mobile/commit/bb47e741a7a25b0a66eb...

  2. Brion Vibber 2011-04-15

    Any issues with this patch? Is there someone specific I should be bringing these to?

  3. Stephen Tramer 2011-04-15

    Make a pull request so we can review, if relevant.

  4. Neeraj Gupta 2012-06-25

    This issue has been fixed as a part of some other fix. It is very possible that this fix is available in releases prior to 2.1.0 release.
  5. Lee Morris 2017-03-07

    Closing ticket due to time passed.

JSON Source