{"id":34188288,"url":"https://github.com/covrom/xml2json","last_synced_at":"2026-03-11T07:02:12.070Z","repository":{"id":50309331,"uuid":"160580288","full_name":"covrom/xml2json","owner":"covrom","description":"Universal unmarshal xml and re-marshal it to json","archived":false,"fork":false,"pushed_at":"2018-12-06T09:20:20.000Z","size":4,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-19T05:54:32.487Z","etag":null,"topics":["conversion","golang","json","xml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/covrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-05T21:22:50.000Z","updated_at":"2022-12-28T02:45:50.000Z","dependencies_parsed_at":"2022-09-08T01:22:51.874Z","dependency_job_id":null,"html_url":"https://github.com/covrom/xml2json","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/covrom/xml2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/covrom%2Fxml2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/covrom%2Fxml2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/covrom%2Fxml2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/covrom%2Fxml2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/covrom","download_url":"https://codeload.github.com/covrom/xml2json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/covrom%2Fxml2json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["conversion","golang","json","xml"],"created_at":"2025-12-15T15:32:13.048Z","updated_at":"2026-03-11T07:02:12.065Z","avatar_url":"https://github.com/covrom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xml2json\nUnmarshal xml and marshal it to json universally.\n\n## Example of translation\n\nThis xml\n```xml\n\u003cdefinitions name = \"HelloService\"\n   targetNamespace = \"http://www.examples.com/wsdl/HelloService.wsdl\"\n   xmlns = \"http://schemas.xmlsoap.org/wsdl/\"\n   xmlns:soap = \"http://schemas.xmlsoap.org/wsdl/soap/\"\n   xmlns:tns = \"http://www.examples.com/wsdl/HelloService.wsdl\"\n   xmlns:xsd = \"http://www.w3.org/2001/XMLSchema\"\u003e\n \n   \u003cmessage name = \"SayHelloRequest\"\u003e\n      \u003cpart name = \"firstName\" type = \"xsd:string\"/\u003e\n   \u003c/message\u003e\n\t\n   \u003cmessage name = \"SayHelloResponse\"\u003e\n      \u003cpart name = \"greeting\" type = \"xsd:string\"/\u003e\n   \u003c/message\u003e\n\n   \u003cportType name = \"Hello_PortType\"\u003e\n      \u003coperation name = \"sayHello\"\u003e\n         \u003cinput message = \"tns:SayHelloRequest\"/\u003e\n         \u003coutput message = \"tns:SayHelloResponse\"/\u003e\n      \u003c/operation\u003e\n   \u003c/portType\u003e\n\n   \u003cbinding name = \"Hello_Binding\" type = \"tns:Hello_PortType\"\u003e\n      \u003csoap:binding style = \"rpc\"\n         transport = \"http://schemas.xmlsoap.org/soap/http\"/\u003e\n      \u003coperation name = \"sayHello\"\u003e\n         \u003csoap:operation soapAction = \"sayHello\"/\u003e\n         \u003cinput\u003e\n            \u003csoap:body\n               encodingStyle = \"http://schemas.xmlsoap.org/soap/encoding/\"\n               namespace = \"urn:examples:helloservice\"\n               use = \"encoded\"/\u003e\n         \u003c/input\u003e\n\t\t\n         \u003coutput\u003e\n            \u003csoap:body\n               encodingStyle = \"http://schemas.xmlsoap.org/soap/encoding/\"\n               namespace = \"urn:examples:helloservice\"\n               use = \"encoded\"/\u003e\n         \u003c/output\u003e\n      \u003c/operation\u003e\n   \u003c/binding\u003e\n\n   \u003cservice name = \"Hello_Service\"\u003e\n      \u003cdocumentation\u003eWSDL File for HelloService\u003c/documentation\u003e\n      \u003cport binding = \"tns:Hello_Binding\" name = \"Hello_Port\"\u003e\n         \u003csoap:address\n            location = \"http://www.examples.com/SayHello/\" /\u003e\n      \u003c/port\u003e\n   \u003c/service\u003e\n\u003c/definitions\u003e\n```\nproduces this json\n```json\n{\n  \"definitions\": {\n    \"binding\": {\n      \"binding\": {\n        \"style\": \"rpc\",\n        \"transport\": \"http://schemas.xmlsoap.org/soap/http\"\n      },\n      \"name\": \"Hello_Binding\",\n      \"operation\": {\n        \"input\": {\n          \"body\": {\n            \"encodingStyle\": \"http://schemas.xmlsoap.org/soap/encoding/\",\n            \"namespace\": \"urn:examples:helloservice\",\n            \"use\": \"encoded\"\n          }\n        },\n        \"name\": \"sayHello\",\n        \"operation\": {\n          \"soapAction\": \"sayHello\"\n        },\n        \"output\": {\n          \"body\": {\n            \"encodingStyle\": \"http://schemas.xmlsoap.org/soap/encoding/\",\n            \"namespace\": \"urn:examples:helloservice\",\n            \"use\": \"encoded\"\n          }\n        }\n      },\n      \"type\": \"tns:Hello_PortType\"\n    },\n    \"message\": [\n      {\n        \"name\": \"SayHelloRequest\",\n        \"part\": {\n          \"name\": \"firstName\",\n          \"type\": \"xsd:string\"\n        }\n      },\n      {\n        \"name\": \"SayHelloResponse\",\n        \"part\": {\n          \"name\": \"greeting\",\n          \"type\": \"xsd:string\"\n        }\n      }\n    ],\n    \"name\": \"HelloService\",\n    \"portType\": {\n      \"name\": \"Hello_PortType\",\n      \"operation\": {\n        \"input\": {\n          \"message\": \"tns:SayHelloRequest\"\n        },\n        \"name\": \"sayHello\",\n        \"output\": {\n          \"message\": \"tns:SayHelloResponse\"\n        }\n      }\n    },\n    \"service\": {\n      \"documentation\": \"WSDL File for HelloService\",\n      \"name\": \"Hello_Service\",\n      \"port\": {\n        \"address\": {\n          \"location\": \"http://www.examples.com/SayHello/\"\n        },\n        \"binding\": \"tns:Hello_Binding\",\n        \"name\": \"Hello_Port\"\n      }\n    },\n    \"soap\": \"http://schemas.xmlsoap.org/wsdl/soap/\",\n    \"targetNamespace\": \"http://www.examples.com/wsdl/HelloService.wsdl\",\n    \"tns\": \"http://www.examples.com/wsdl/HelloService.wsdl\",\n    \"xmlns\": \"http://schemas.xmlsoap.org/wsdl/\",\n    \"xsd\": \"http://www.w3.org/2001/XMLSchema\"\n  }\n}\n```\nBenchamrk for this sample:\n```\nBenchmarkXMLNode_UnmarshalXML-4            10000            135491 ns/op\nBenchmarkXMLNode_MarshalJSON-4             20000             85595 ns/op\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovrom%2Fxml2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcovrom%2Fxml2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcovrom%2Fxml2json/lists"}