Get XML attribute on 2012 platform
XML attributes referencing on different SmartTV platforms
For access data received through an XML response, parsing is employed, there is difference in accessing attribute in XML.
- Maple
- Accessing of attribute inside XML is possible by ”.”
- Webkit
- Access is not possible by attribute inside XML.
Solution
Use getAttribute() operated in all the browser.
Source Files
Note
The files needed for the sample application are here.
Bad example
var service = objPreview.service;
Good example
var service = objPreview.getAttribute('service');