{"id":18383178,"url":"https://github.com/fugerit-org/fj-xml-to-json","last_synced_at":"2025-04-11T21:36:30.541Z","repository":{"id":197566984,"uuid":"698892907","full_name":"fugerit-org/fj-xml-to-json","owner":"fugerit-org","description":"Module to convert xml to json and viceversa","archived":false,"fork":false,"pushed_at":"2025-03-14T17:12:48.000Z","size":56,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T18:30:40.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fugerit-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-01T09:54:14.000Z","updated_at":"2025-03-14T17:12:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"a7b205dc-497c-4f44-b509-532cbc2e412e","html_url":"https://github.com/fugerit-org/fj-xml-to-json","commit_stats":null,"previous_names":["fugerit-org/fj-xml-to-json"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Ffj-xml-to-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Ffj-xml-to-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Ffj-xml-to-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Ffj-xml-to-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fugerit-org","download_url":"https://codeload.github.com/fugerit-org/fj-xml-to-json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248484526,"owners_count":21111662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:10:23.811Z","updated_at":"2025-04-11T21:36:30.518Z","avatar_url":"https://github.com/fugerit-org.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fj-xml-to-json\n\nModule to convert xml to json and viceversa\n\n[![Keep a Changelog v1.1.0 badge](https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735)](https://github.com/fugerit-org/fj-xml-to-json/blob/master/CHANGELOG.md) \n[![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/fj-xml-to-json.svg)](https://mvnrepository.com/artifact/org.fugerit.java/fj-xml-to-json)\n[![license](https://img.shields.io/badge/License-Apache%20License%202.0-teal.svg)](https://opensource.org/licenses/Apache-2.0)\n[![code of conduct](https://img.shields.io/badge/conduct-Contributor%20Covenant-purple.svg)](https://github.com/fugerit-org/fj-universe/blob/main/CODE_OF_CONDUCT.md)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_fj-xml-to-json\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=fugerit-org_fj-xml-to-json)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_fj-xml-to-json\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=fugerit-org_fj-xml-to-json)\n\n[![Java runtime version](https://img.shields.io/badge/run%20on-java%208+-%23113366.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html)\n[![Java build version](https://img.shields.io/badge/build%20on-java%2011+-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)](https://universe.fugerit.org/src/docs/versions/java11.html)\n[![Apache Maven](https://img.shields.io/badge/Apache%20Maven-3.9.0+-C71A36?style=for-the-badge\u0026logo=Apache%20Maven\u0026logoColor=white)](https://universe.fugerit.org/src/docs/versions/maven3_9.html)\n[![Fugerit Github Project Conventions](https://img.shields.io/badge/Fugerit%20Org-Project%20Conventions-1A36C7?style=for-the-badge\u0026logo=Onlinect%20Playground\u0026logoColor=white)](https://universe.fugerit.org/src/docs/conventions/index.html)\n\n## Quickstart\n\nSample code to convert from XML to JSON : \n\n```\n\t\ttry ( Reader reader = StreamHelper.resolveReader( path ) ) {\n\t\t\tXmlToJsonHandler handler = new XmlToJsonHandler();\n\t\t\tJsonNode node = handler.convertToJsonNode(reader);\n\t\t\thandler.getMapper().writerWithDefaultPrettyPrinter().writeValue( outputFile , node );\n\t\t}\n```\n\nFor instance a xml like this : \n\n```\n\u003cconfig default-list=\"list1\"\u003e\n\t\u003ctest-list id=\"list1\"\u003e\n\t\t\u003ctest-entry id=\"entry1\"\u003eEntry 1\u003c/test-entry\u003e\n\t\t\u003ctest-entry id=\"entry2\"\u003eEntry 2\u003c/test-entry\u003e\n\t\u003c/test-list\u003e\n\u003c/config\u003e\n```\n\nWill be converted to : \n\n```\n{\n  \"default-list\" : \"list1\",\n  \"_t\" : \"config\",\n  \"_e\" : [ {\n    \"id\" : \"list1\",\n    \"_t\" : \"test-list\",\n    \"_e\" : [ {\n      \"id\" : \"entry1\",\n      \"_t\" : \"test-entry\",\n      \"_v\" : \"Entry 1\"\n    }, {\n      \"id\" : \"entry2\",\n      \"_t\" : \"test-entry\",\n      \"_v\" : \"Entry 2\"\n    } ]\n  } ]\n}\n```\n\n```\n\t\ttry ( Reader reader = StreamHelper.resolveReader( path );\n\t\t\t\tFileWriter writer = new FileWriter(outputFile) ) {\n\t\t\tXmlToJsonHandler handler = new XmlToJsonHandler();\n\t\t\tElement root = handler.convertToElement( reader );\n\t\t\tDOMIO.writeDOMIndent( root , writer );\n\t\t}\n```\n\nSee [conversion conventions](src/main/docs/xml_conversion.md) below for more info.\n\n## Documentation\n\n- xml to json conversion conventions (see [xml conversion](src/main/docs/xml_conversion.md))\n- [yaml support](src/main/docs/yaml_support.md) documentation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffugerit-org%2Ffj-xml-to-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffugerit-org%2Ffj-xml-to-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffugerit-org%2Ffj-xml-to-json/lists"}