getXMLForFileId
Description
Retrieves a raw XML string and parsed object array for a given XML file id.
Syntax
VabletNativeInterface.callNativeMethod('getXMLForFileId', {fileId: 123}, (res)=>{...})
Options
| Key |
Type |
Description |
| fileId |
int |
fileId of the XML file to be parsed. |
Response
| Key |
Type |
Description |
| success |
boolean |
Returns true on success and false for any errors. |
| error |
string |
Error message, provided there is one. |
| xmlString |
string |
A string containing the raw XML data. |
| parsedXML |
object |
A parsed object from the XML data. Uses the first row for key names. |
Example
VabletNativeInterface.callNativeMethod(
'getXMLForFileId',
{fileId: 123},
(res)=>{
if (res.success) {
// Success! Extract values from response
const {xmlString, parsedXML} = res;
// Do something!
alert("Raw XML Data", xmlString);
alert("Parsed XML Object", parsedXML);
} else {
// Uh oh, let's alert the error!
alert(res.error)
}
}
);