[TIMOB-1624] iOS: TiDOMNode nextSibling, previousSibling properties skip non-element nodes
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-06-25T13:22:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.1.0 |
Components | iOS |
Labels | api |
Reporter | Brion Vibber |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:57:41.000+0000 |
Updated | 2017-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
- 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... - Brion Vibber 2011-04-15
Any issues with this patch? Is there someone specific I should be bringing these to?
- Stephen Tramer 2011-04-15
Make a pull request so we can review, if relevant.
- 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.
- Lee Morris 2017-03-07 Closing ticket due to time passed.