json2xml

Convert json to xml : JsonNode( comapatible with module json ) To XmlNode (comapatible with module xmltree)

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install json2xml
choosenim install json2xml
git clone https://github.com/MhedhebiIssam/json2xml

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
json2xml - - - - - - -

Source

Repository https://github.com/MhedhebiIssam/json2xml
Homepage https://github.com/MhedhebiIssam/json2xml
Registry Source nimble_official

README

json2xml '[_]'

  • convert json to xml : JsonNode json to xmltree type XmlNode

Install

  • nimble install json2xml

Usage

  • example
import json , xmltree , json2xml 
var js = %* {
    "Name": "voldemort",
    "Designation": "PHP Developer",
    "Salary": 98000,
    "Age": 27,
    "Projects": [
        {
            "Topic": "Smart Ambulance",
            "Category": "Android Application",
            "Months": 2
        },
        {
            "Topic": "AST",
            "Category": "Embedded System",
            "Months": 1
        },
        {
            "Topic": "Plant Nursery",
            "Category": "Website",
            "Months": 3
        }
    ]
}
var xml_from_json : XmlNode = json2xml(js)
echo xml_from_json 
  • output
<json type="object">
  <json type="key" name="Name"><json type="string">voldemort</json></json>
  <json type="key" name="Designation"><json type="string">PHP Developer</json></json>
  <json type="key" name="Salary"><json type="int">98000</json></json>
  <json type="key" name="Age"><json type="int">27</json></json>
  <json type="key" name="Projects"><json type="list">
      <json type="index" value="0"><json type="object">
          <json type="key" name="Topic"><json type="string">Smart Ambulance</json></json>
          <json type="key" name="Category"><json type="string">Android Application</json></json>
          <json type="key" name="Months"><json type="int">2</json></json>
        </json></json>
      <json type="index" value="1"><json type="object">
          <json type="key" name="Topic"><json type="string">AST</json></json>
          <json type="key" name="Category"><json type="string">Embedded System</json></json>
          <json type="key" name="Months"><json type="int">1</json></json>
        </json></json>
      <json type="index" value="2"><json type="object">
          <json type="key" name="Topic"><json type="string">Plant Nursery</json></json>
          <json type="key" name="Category"><json type="string">Website</json></json>
          <json type="key" name="Months"><json type="int">3</json></json>
        </json></json>
    </json></json>
</json>