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

xmlTool

v1.0.1 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.

  •   Jeff Stevens
  • Published
  • 1.0.1 is the latest of 2 release(s)
    Published
  • Published on {{ getFullDate("2025-08-08T20:17:17Z") }}

$ box install xmlTool

No collaborators yet.
5.00 / 2
  • {{ getFullDate("2022-02-28T14:40:11Z") }}
  • {{ getFullDate("2025-08-08T20:17:17Z") }}
  • 2,553
  • 74