Problem
On iOS, getAttributeNS doesn't accept a null first argument. It requires a string. This isn't consistent with browser behavior, which accepts a null value. The same applies to createAttributeNS.
Expected Behavior
Calling getAttributeNS with null as the first argument should behave identically to getAttribute. The same applies to createAttributeNS.
Reproduction
var xmlDoc = Ti.XML.parseString('<html><head></head><body><a href="http://appcelerator.com/" /></body></html>');
var anchor = xmlDoc.getElementsByTagName('a').item(0);
try {
alert(anchor.getAttributeNS(null, 'href'));
}
catch (err) {
alert('FAIL: getAttributeNS: ' + err);
}
try {
alert(xmlDoc.createAttributeNS(null, 'id'));
}
catch (err) {
alert('FAIL: createAttributeNS: ' + err);
}
Pull pending https://github.com/appcelerator/titanium_mobile/pull/2162
Tested with 2.0.2.v20120514121649 on iPhone 4 5.0.1 (need to add var win = TI.UI.createWindow(); when building to device)
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5039