Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Function: toXML()

Converts an object or JSON string to XML.  

Syntax

toXML(input, root)

ArgumentTypeDescription
input

Object

JSON String

The object or JSON string to be converted to XML.
rootStringThe name given to the root element.

Example

Input
toXML(getCo, "CompaniesData")

Returns

<CompaniesData><CompaniesData><CompanyID>102</CompanyID><CompanyName>Lockman, Barrows and Kessler</CompanyName><Industry>Telecoms</Industry></CompaniesData><CompaniesData><CompanyID>103</CompanyID><CompanyName>Boyle, Bogan and Mohr</CompanyName><Industry>Telecoms</Industry></CompaniesData><CompaniesData><CompanyID>104</CompanyID><CompanyName>Kassulke LLC</CompanyName><Industry>Telecoms</Industry></CompaniesData></CompaniesData>
 Pretty Printed
<CompaniesData>
    <CompaniesData>
        <CompanyID>102</CompanyID>
        <CompanyName>Lockman, Barrows and Kessler</CompanyName>
        <Industry>Telecoms</Industry>
    </CompaniesData>
    <CompaniesData>
        <CompanyID>103</CompanyID>
        <CompanyName>Boyle, Bogan and Mohr</CompanyName>
        <Industry>Telecoms</Industry>
    </CompaniesData>
    <CompaniesData>
        <CompanyID>104</CompanyID>
        <CompanyName>Kassulke LLC</CompanyName>
        <Industry>Telecoms</Industry>
    </CompaniesData>
</CompaniesData>

See Also

  • No labels