ph_xmltojson PowerHome formula function
Description
Converts an XML string to equivalent JSON
using a C#
JsonConvert object
Syntax
ph_xmltojson ( as_xml )
Argument | Description |
as_xml | String. A string containing the XML data you
wish to convert to JSON |
Return value
String. Returns the XML data converted
to a JSON string. Returns "*ERROR* - " followed by details of the error if
an exception occurs
Usage
Use this function to convert XML data to
equivalent
JSON data
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_xmltojson(ph_readfile("c:\powerhome\phdata.xml"))
- Returns the XML data contained in the c:\powerhome\phdata.xml file as an
equivalent JSON string. If the XML is not properly formatted and valid XML, then
a string starting with "*ERROR* - " will be returned followed by the error
details