Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Converts XML to JSON.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XML | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
XML | The XML to process. | "<test>Hello</test>" | |
Flags | Various Flags. Add 1 to ignore errors in xml and continue parsing. This may lead to not everything in the xml being read. Add 2 to put attributs inline. Add 4 to make entries with true/false being boolean. Add 8 to make entries with numbers as numbers. Add 16 to include namespaces. Add 32 to use empty text for empty xml nodes. |
0 | Optional |
Returns JSON or error.
Try it:
Set Variable [ $XML ; Value: MBS( "JSON.ToXML"; "{\"Hello\": \"World\"}"; "test") ]
Show Custom Dialog [ $xml ]
Set Variable [ $JSON ; Value: MBS( "XML.ToJSON"; $XML) ]
Show Custom Dialog [ $json ]
Try with boolean and number detection:
MBS( "XML.ToJSON";
"<test>
<value>123</value>
<value>45.67</value>
<value>true</value>
<value>false</value>
<value>Hello</value>
</test>"; 4 + 8 )
Example result:
{
"test": {
"value": [123, 45.67, true, false, "Hello"]
}
}
This function checks for a license.
Created 27th April 2018, last changed 13th April 2023