{"id":24108216,"url":"https://github.com/outofcoffee/go-xml-example-generator","last_synced_at":"2025-02-28T02:47:37.947Z","repository":{"id":271805047,"uuid":"914523800","full_name":"outofcoffee/go-xml-example-generator","owner":"outofcoffee","description":"A Go tool that generates sample XML snippets from XSD schemas. Given an XSD schema and an element name, it produces a valid XML sample that matches the schema's structure.","archived":false,"fork":false,"pushed_at":"2025-01-29T09:42:58.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T09:43:10.923Z","etag":null,"topics":["example-generator","generator","golang","xml","xml-schema"],"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/outofcoffee.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2025-01-09T19:05:40.000Z","updated_at":"2025-01-29T09:43:02.000Z","dependencies_parsed_at":"2025-01-10T01:31:46.623Z","dependency_job_id":"1301d49f-ff19-4473-955f-1cb538613fec","html_url":"https://github.com/outofcoffee/go-xml-example-generator","commit_stats":null,"previous_names":["outofcoffee/go-xml-example-generator"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fgo-xml-example-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fgo-xml-example-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fgo-xml-example-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outofcoffee%2Fgo-xml-example-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outofcoffee","download_url":"https://codeload.github.com/outofcoffee/go-xml-example-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241090610,"owners_count":19907983,"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":["example-generator","generator","golang","xml","xml-schema"],"created_at":"2025-01-10T23:26:28.203Z","updated_at":"2025-02-28T02:47:37.942Z","avatar_url":"https://github.com/outofcoffee.png","language":"Go","readme":"# go-xml-example-generator [![Build and Test](https://github.com/outofcoffee/go-xml-example-generator/actions/workflows/build.yml/badge.svg)](https://github.com/outofcoffee/go-xml-example-generator/actions/workflows/build.yml)\n\nA Go tool/library that generates example XML snippets from XSD schemas. Given an XSD schema and an element name, it produces a valid XML example that matches the schema's structure.\n\n## Features\n\n- Generates example XML for any element defined in an XSD schema\n- Handles complex types with nested elements\n- Supports common XSD types (string, int, boolean, date, etc.)\n- Optional namespace support with custom prefixes\n\n## Installation\n\nAs a command line tool:\n```bash\ngo install github.com/outofcoffee/go-xml-example-generator@latest\n```\n\nAs a dependency in your Go project:\n```bash\ngo get github.com/outofcoffee/go-xml-example-generator\n```\n\n## Usage\n\n### Command Line\n```bash\ngo-xml-example-generator [xsd_path] [element_name]\n```\n\nFor example:\n```bash\ngo-xml-example-generator schemas/petstore.xsd getPetByIdResponse\n```\n\nThis will output something like:\n```xml\n\u003cgetPetByIdResponse\u003e\n  \u003cid\u003e42\u003c/id\u003e\n  \u003cname\u003ecolour\u003c/name\u003e\n\u003c/getPetByIdResponse\u003e\n```\n\n### As a Library\n\nBasic usage:\n```go\nimport \"github.com/outofcoffee/go-xml-example-generator/examplegen\"\n\n// Generate XML from an XSD file\nxml, err := examplegen.Generate(\"path/to/schema.xsd\", \"elementName\")\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Println(xml)\n```\n\nWith namespace support:\n```go\n// Generate XML with a namespace and prefix\nxml, err := examplegen.GenerateWithNs(\"path/to/schema.xsd\", \"elementName\", \"urn:foo:bar\", \"foo\")\nif err != nil {\n    log.Fatal(err)\n}\nfmt.Println(xml)\n// Output:\n// \u003cfoo:elementName xmlns:foo=\"urn:foo:bar\"\u003e\n//   \u003cfoo:childElement\u003evalue\u003c/foo:childElement\u003e\n// \u003c/foo:elementName\u003e\n```\n\n## Building from Source\n\n```bash\ngit clone https://github.com/outofcoffee/go-xml-example-generator.git\ncd go-xml-example-generator\ngo build\n```\n\n## Running Tests\n\n```bash\ngo test ./...\n```\n\n## Dependencies\n\n- github.com/xuri/xgen - XML schema parser\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Author\n\n[outofcoffee](https://github.com/outofcoffee) ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutofcoffee%2Fgo-xml-example-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutofcoffee%2Fgo-xml-example-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutofcoffee%2Fgo-xml-example-generator/lists"}