ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / XML file functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Converts an XML string to JSON.
Example
xml1 is xmlDocument = XMLOpen([
<document>
 <name>TestName</name>
 <id>2</id>
 <true>true</true>
 <list>
   <item>5</item>
   <item>5</item>
   <item>6</item>
   <item>2</item>
   <item>47</item>
 </list>
</document>
], fromString)
 
Trace(XMLToJSON(xml1))
 
// Result displayed: { "name":"TestName", "id":2, "true":true, "list":[ 5, 5, 6, 2, 47 ] }
Syntax
<Result> = XMLToJSON(<XML to convert> [, <Converter>])
<Result>: JSON variable
JSON variable that corresponds to the converted XML element.
<XML to convert>: xmlNode or xmlDocument variable
Name of a variable of type xmlDocument or xmlNode. In the case of a variable of type xmlDocument, only the first node will be converted.
<Converter>: Optional JSONXMLConverter variable
Name of the JSONXMLConverter variable that corresponds to the custom conversion standard to be applied.
Caution: This customization requires a good knowledge of XML.
If this parameter is not specified, a default standard will be used for the conversion: the default values of the JSONXMLConverter variable are used.
Business / UI classification: Neutral code
Component: wd300vm.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 04/28/2023

Send a report | Local help