Component: XML JSON Parser (Runtime Tools): Difference between revisions
Appearance
No edit summary |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (10 intermediate revisions by 2 users not shown) | |||
| Line 16: | Line 16: | ||
==Component Source Code== | ==Component Source Code== | ||
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_XMLParser.fcfx FC_Comp_Source_XMLParser.fcfx] | |||
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_XMLParser.fcfx FC_Comp_Source_XMLParser.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_XMLParser.fcfx FC_Comp_Source_XMLParser.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
| Line 28: | Line 36: | ||
==Examples== | ==Examples== | ||
| Line 35: | Line 49: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
{| class="wikitable | |||
==Macro reference== | |||
===AddObject=== | |||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''AddObject''' | ||
|- | |- | ||
| colspan="2" | Adds a tag at the selected location. Use the GetRootHandle and runtime API Tree functions . Returns the handle of the new object. | | colspan="2" | Adds a tag at the selected location. Use the GetRootHandle and runtime API Tree functions . Returns the handle of the new object. | ||
| Line 137: | Line 90: | ||
{| class="wikitable | ===BuildJSONString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BuildJSONString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Generate a JSON string based on the current objects inside the component. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===BuildXMLString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''BuildXMLString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Generate a XML string based on the current objects inside the component. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| Line 196: | Line 118: | ||
{| class="wikitable | ===ClearObjects=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ClearObjects''' | ||
|- | |- | ||
| colspan="2" | Deletes all object data ready for fresh input | | colspan="2" | Deletes all object data ready for fresh input | ||
| Line 209: | Line 132: | ||
===DeleteObject=== | |||
{| class="mtx-class-macrotable wikitable" | |||
{| class=" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''DeleteObject''' | ||
|- | |- | ||
| colspan="2" | Deletes a selected tag object. | | colspan="2" | Deletes a selected tag object. | ||
| Line 258: | Line 151: | ||
{| class="wikitable | ===FindNextObject=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FindNextObject''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | 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. | ||
|- | |- | ||
|- | |- | ||
| Line 271: | Line 165: | ||
| colspan="2" | e.g. "item.title" | | colspan="2" | e.g. "item.title" | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===FindNextObjectString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FindNextObjectString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Searches for and then collects the data string from the specified path. Returns the first matching path from the last search | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | SubObjPath | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | e.g. "item.title" | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===FindObject=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FindObject''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Finds the first instance of an object. Returns the first matching path from the root. Returns 0 if the path was not found. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | ObjPath | ||
|- | |- | ||
| colspan="2" | e.g. "rss.channel.title" | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
| Line 382: | Line 208: | ||
{| class="wikitable | ===FindObjectString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FindObjectString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Searches for and then collects the data string from the specified path. Returns the first matching path from the root. | ||
|- | |- | ||
|- | |- | ||
| Line 395: | Line 222: | ||
| colspan="2" | e.g. "rss.channel.title" | | colspan="2" | e.g. "rss.channel.title" | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===GetObjectString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetObjectString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Collects the data string from the specified object. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
| width="90%" | | | width="90%" | Object | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Handle to the object | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | ||
| Line 418: | Line 246: | ||
{| class="wikitable | ===GetObjectTag=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetObjectTag''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Collects the tag string from the specified object. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | | width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
| width="90%" | | | width="90%" | Object | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Handle to the object | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===GetRootHandle=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''GetRootHandle''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Allows for user to step through the objects manually using the inbuilt runtime api calls. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
| Line 464: | Line 279: | ||
{| class="wikitable | ===ParseJSONDataString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ParseJSONDataString''' | ||
|- | |- | ||
| colspan="2" | Parses JSON formatted data in a piecemeal format as and when file data is available. Creates objects to store the contents of the JSON | | colspan="2" | Parses JSON formatted data in a piecemeal format as and when file data is available. Creates objects to store the contents of the JSON | ||
| Line 487: | Line 303: | ||
{| class="wikitable | ===ParseXMLDataString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ParseXMLDataString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Parses XML formatted data in a piecemeal format as and when file data is available. Creates objects to store the contents of the XML. | ||
|- | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9- | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | Data | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | XML Data string, can be a chunk of a file at a time | ||
|- | |- | ||
| width="10%" align="center | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" | Length | |||
| width="90% | |||
|- | |- | ||
| colspan="2" | Number of bytes to process | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 518: | Line 327: | ||
{| class="wikitable | ===SetObjectString=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetObjectString''' | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | Sets the data string of an existing object. | ||
|- | |- | ||
|- | |- | ||
| Line 561: | Line 340: | ||
|- | |- | ||
| colspan="2" | Handle to the object | | colspan="2" | Handle to the object | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| width="90%" | | | width="90%" | Data | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
{| class="wikitable | ===SetObjectTag=== | ||
{| class="mtx-class-macrotable wikitable" | |||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SetObjectTag''' | ||
|- | |- | ||
| colspan="2" | Sets the tag name of an existing object. | | colspan="2" | Sets the tag name of an existing object. | ||
| Line 619: | Line 373: | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
==Property reference== | ==Property reference== | ||
{| class="wikitable | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|} | |} | ||
Latest revision as of 14:23, 13 July 2026
| Author | MatrixTSL |
| Version | 1.0 |
| Category | Runtime Tools |
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.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_XMLParser.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_XMLParser.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
AddObject
BuildJSONString
| BuildJSONString | |
| Generate a JSON string based on the current objects inside the component. | |
| Return | |
BuildXMLString
| BuildXMLString | |
| Generate a XML string based on the current objects inside the component. | |
| Return | |
ClearObjects
| ClearObjects | |
| Deletes all object data ready for fresh input | |
| Return | |
DeleteObject
| DeleteObject | |
| Deletes a selected tag object. | |
| Object | |
| Handle to the object | |
| Return | |
FindNextObject
FindNextObjectString
| FindNextObjectString | |
| Searches for and then collects the data string from the specified path. Returns the first matching path from the last search | |
| SubObjPath | |
| e.g. "item.title" | |
| Return | |
FindObject
| FindObject | |
| Finds the first instance of an object. Returns the first matching path from the root. Returns 0 if the path was not found. | |
| ObjPath | |
| e.g. "rss.channel.title" | |
| Return | |
FindObjectString
| FindObjectString | |
| Searches for and then collects the data string from the specified path. Returns the first matching path from the root. | |
| ObjPath | |
| e.g. "rss.channel.title" | |
| Return | |
GetObjectString
| GetObjectString | |
| Collects the data string from the specified object. | |
| Object | |
| Handle to the object | |
| Return | |
GetObjectTag
| GetObjectTag | |
| Collects the tag string from the specified object. | |
| Object | |
| Handle to the object | |
| Return | |
GetRootHandle
| GetRootHandle | |
| Allows for user to step through the objects manually using the inbuilt runtime api calls. | |
| Return | |
ParseJSONDataString
ParseXMLDataString
SetObjectString
| SetObjectString | |
| Sets the data string of an existing object. | |
| Object | |
| Handle to the object | |
| Data | |
| Return | |
SetObjectTag
| SetObjectTag | |
| Sets the tag name of an existing object. | |
| Object | |
| Handle to the object | |
| Tag | |
| Return | |
Property reference
| Properties |