[TIMOB-1752] ChildNodes for Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-08-20T16:18:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, childnodes, domnode, domnodelist, haschilds, length, ti.domnodelist, xml |
Reporter | Gilliard Lopes |
Assignee | Neeraj Gupta |
Created | 2011-04-15T03:01:21.000+0000 |
Updated | 2017-03-09T23:35:15.000+0000 |
Description
Hello,
I'm using the childNodes property for iPhone and Android. On iPhone, it works fine and return the children nodes correctly. But, on Android, it returns something very strange. According DOMNode documentation to childNodes property: "Returns a DOMNodeList that contains all children of this node. If there are no children, this is an empty DOMNodeList". You can see the Ti.DOMNodeList object for both (android and iPhone) but if you call childNodes.length on Android it returns a "magic" number different of the real number of childrens that is returned properly on iPhone. In other words, on iPhone is everything fine, on Android the childNodes property doesn't works properly.
Regards.
Gilliard, is this simply because on Android the parsed DOM tree includes whitespace which appears to be stripped out by the parsing on iPhone?
Please go ahead and iterate over the nodes and check what they are. You should find the same element nodes on both systems. (childNodes DOES NOT only include elements! It also includes text nodes, comment nodes, etc.)
Hum, i understand what you said. I tested in my app and confirmed your affirmative.
Thanks for the help!!
Regards.
No test case, ticket marked as invalid.
It appears that it was a whitespace issue and not a platform issue. Please reopen this ticket if you can provide a test case or better description to reproduce this issue.
Closing ticket as invalid.