Component: XML JSON Parser (Runtime Tools)
Author | MatrixTSL |
Version | 1.0 (Release) |
Category | Runtime Tools |
Contents
XML JSON Parser component
A component designed to simplify the collection of data from XML and JSON sources. Parses the raw data and creates a dynamic representation of the data that is easy to navigate and interrogate. Also allows the objects to be manually created or edited and then re-exported as XML or JSON format.
Examples
No additional examples
Downloadable macro reference
This component does not contain any downloadable macros
Simulation macro reference
SetObjectString
Sets the data string of an existing object.
Parameters
- HANDLE Object
- Handle to the object
- <- STRING Data
- This parameter may be returned back to the caller
Return value
- This call does not return a value
FindObject
Finds the first instance of an object.
Returns the first matching path from the root.
Returns 0 if the path was not found.
Parameters
- <- STRING ObjPath
- e.g. "rss.channel.title"
- This parameter may be returned back to the caller
Return value
GetRootHandle
Allows for user to step through the objects manually using the inbuilt runtime api calls.
Parameters
- This macro has no parameters
Return value
FindObjectString
Searches for and then collects the data string from the specified path.
Returns the first matching path from the root.
Parameters
- <- STRING ObjPath
- e.g. "rss.channel.title"
- This parameter may be returned back to the caller
Return value
AddObject
Adds a tag at the selected location.
Use the GetRootHandle and runtime API Tree functions .
Returns the handle of the new object.
Parameters
- HANDLE ParentObject
- The Object Handle to store the new tag inside
- <- STRING Tag
- Name of the object
- This parameter may be returned back to the caller
- <- STRING Data
- data for the object (optional)
- This parameter may be returned back to the caller
Return value
FindNextObject
Finds the next instance of an object following a GetObject* call.
Returns the first matching path from the last search.
Returns 0 if the path was not found.
Parameters
- <- STRING SubObjPath
- e.g. "item.title"
- This parameter may be returned back to the caller
Return value
ParseJSONDataString
Parses JSON formatted data in a piecemeal format as and when file data is available.
Creates objects to store the contents of the JSON
Parameters
- <- STRING Data
- JSON Data string, can be a chunk of a file at a time
- This parameter may be returned back to the caller
- UINT Length
- Number of Bytes to process
Return value
- This call does not return a value
GetObjectString
Collects the data string from the specified object.
Parameters
- HANDLE Object
- Handle to the object
Return value
ClearObjects
Deletes all object data ready for fresh input
Parameters
- This macro has no parameters
Return value
- This call does not return a value
GetObjectTag
Collects the tag string from the specified object.
Parameters
- HANDLE Object
- Handle to the object
Return value
DeleteObject
Deletes a selected tag object.
Parameters
- HANDLE Object
- Handle to the object
Return value
- BOOL : Returns true if the operation is a success, else false
FindNextObjectString
Searches for and then collects the data string from the specified path.
Returns the first matching path from the last search
Parameters
- <- STRING SubObjPath
- e.g. "item.title"
- This parameter may be returned back to the caller
Return value
SetObjectTag
Sets the tag name of an existing object.
Parameters
- HANDLE Object
- Handle to the object
- <- STRING Tag
- This parameter may be returned back to the caller
Return value
- This call does not return a value
ParseXMLDataString
Parses XML formatted data in a piecemeal format as and when file data is available.
Creates objects to store the contents of the XML.
Parameters
- <- STRING Data
- XML Data string, can be a chunk of a file at a time
- This parameter may be returned back to the caller
- UINT Length
- Number of bytes to process
Return value
- This call does not return a value
Property reference
This component does not contain any properties