BoxLang 🚀 A New JVM Dynamic Language Learn More...

xmlTool

v1.0 Modules

A simple package used for casting XML to structs and JSON.

/***** INSTALLATION *****/

box install xmlTool

/***** USER GUIDE *****/

Here are xmlTool's functions:

struct function convertXMLtoStruct(required xml)

This function converts an XML coldfusion object into a struct by extracting the text and child tags from any given tag and nesting each pair inside of a struct together.

-string function convertXMLtoJSON(required xml)

This function uses convertXMLtoStruct and then simply uses the serializeJSON() function to return a JSON formatted string of the original XML document

any function convertJSONtoXML(required string json)

This function uses Coldbox's deserializeJSON function to make a struct, and then passes that given struct into Coldbox's XmlConverter to make an XML document object.

A simple package used for casting XML to structs and JSON.

$ box install xmlTool

No collaborators yet.
5.00 / 2
  • {{ getFullDate("2022-02-28T14:40:11Z") }}
  • {{ getFullDate("2023-04-17T12:35:46Z") }}
  • 1,887
  • 49