top

Get XML attribute on 2012 platform

Published 2014-10-27 | (Compatible with SDK 3.5,4.5,5.0,5.1 and 2012,2013,2014 models)

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');