{"id":13786731,"url":"https://github.com/xuri/xgen","last_synced_at":"2025-04-04T17:06:38.484Z","repository":{"id":37713642,"uuid":"193239761","full_name":"xuri/xgen","owner":"xuri","description":"XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator","archived":false,"fork":false,"pushed_at":"2024-07-22T13:15:45.000Z","size":129,"stargazers_count":358,"open_issues_count":40,"forks_count":88,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-28T16:04:55.174Z","etag":null,"topics":["code-generator","ecma-376","generator","go","golang","ooxml","ooxml-parser","w3c","w3c-specification","xml","xml-parser","xml-parsing","xsd","xsd-schema"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"xuri","patreon":"xuri","ko_fi":"xurime","liberapay":"xuri","issuehunt":"xuri","custom":"https://www.paypal.com/paypalme/xuri"}},"created_at":"2019-06-22T13:56:05.000Z","updated_at":"2025-03-26T23:52:45.000Z","dependencies_parsed_at":"2023-02-12T23:32:08.039Z","dependency_job_id":"6dc094ed-b46d-493c-913f-0552a8589f45","html_url":"https://github.com/xuri/xgen","commit_stats":{"total_commits":52,"total_committers":12,"mean_commits":4.333333333333333,"dds":"0.34615384615384615","last_synced_commit":"db840e1a460537cf4f90c2a88cffe11ef354dd9f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuri%2Fxgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuri%2Fxgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuri%2Fxgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuri%2Fxgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuri","download_url":"https://codeload.github.com/xuri/xgen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217175,"owners_count":20903009,"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":["code-generator","ecma-376","generator","go","golang","ooxml","ooxml-parser","w3c","w3c-specification","xml","xml-parser","xml-parsing","xsd","xsd-schema"],"created_at":"2024-08-03T19:01:31.604Z","updated_at":"2025-04-04T17:06:38.459Z","avatar_url":"https://github.com/xuri.png","language":"Go","readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"450\" src=\"./xgen.svg\" alt=\"xgen logo\"\u003e\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/xuri/xgen/actions?workflow=Go\"\u003e\u003cimg src=\"https://github.com/xuri/xgen/workflows/Go/badge.svg?branch=master\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/xuri/xgen\"\u003e\u003cimg src=\"https://codecov.io/gh/xuri/xgen/branch/master/graph/badge.svg\" alt=\"Code Coverage\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/xuri/xgen\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/xuri/xgen\" alt=\"Go Report Card\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/xuri/xgen\"\u003e\u003cimg src=\"https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\" alt=\"go.dev\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/BSD-3-Clause\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-bsd-orange.svg\" alt=\"Licenses\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.paypal.me/xuri\"\u003e\u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-green.svg\" alt=\"Donate\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# xgen\n\n## Introduction\n\nxgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This library needs Go version 1.10 or later. The full API docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/xuri/xgen).\n\n`xgen` commands automatically compiles XML schema files into the multi-language type or class declarations code.\n\nInstall the command line tool first.\n\nIf you're using Go 1.17 and later, installing executables with `go install`\n\n```sh\ngo install github.com/xuri/xgen/cmd/xgen@latest\n```\n\nIf you're using Go 1.16 and earlier, installing executables with `go get`\n\n```sh\ngo get -u -v github.com/xuri/xgen/cmd/...\n```\n\nThe command below will walk on the `xsd` path and generate Go language struct code under the `output` directory.\n\n```text\n$ xgen -i /path/to/your/xsd -o /path/to/your/output -l Go\n```\n\nUsage:\n\n```text\n$ xgen [\u003cflag\u003e ...] \u003cXSD file or directory\u003e ...\n   -i \u003cpath\u003e Input file path or directory for the XML schema definition\n   -o \u003cpath\u003e Output file path or directory for the generated code\n   -p        Specify the package name\n   -l        Specify the language of generated code (Go/C/Java/Rust/TypeScript)\n   -h        Output this help and exit\n   -v        Output version and exit\n```\n\n## XSD (XML Schema Definition)\n\nXSD, a recommendation of the World Wide Web Consortium ([W3C](https://www.w3.org)), specifies how to formally describe the elements in an Extensible Markup Language ([XML](https://www.w3.org/TR/xml/)) document. It can be used by programmers to verify each piece of item content in a document. They can check if it adheres to the description of the element it is placed in.\n\nXSD can be used to express a set of rules to which an XML document must conform in order to be considered \"valid\" according to that schema. However, unlike most other schema languages, XSD was also designed with the intent that determination of a document's validity would produce a collection of information adhering to specific data types. Such a post-validation infoset can be useful in the development of XML document processing software.\n\n## Contributing\n\nContributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change. XSD is compliant with [XML Schema Part 1: Structures Second Edition](https://www.w3.org/TR/xmlschema-1/).\n\n## Licenses\n\nThis program is under the terms of the BSD 3-Clause License. See [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause).\n\nLogo is designed by [xuri](https://xuri.me). Licensed under the [Creative Commons 3.0 Attributions license](http://creativecommons.org/licenses/by/3.0/).\n","funding_links":["https://github.com/sponsors/xuri","https://patreon.com/xuri","https://ko-fi.com/xurime","https://liberapay.com/xuri","https://issuehunt.io/r/xuri","https://www.paypal.com/paypalme/xuri","https://www.paypal.me/xuri"],"categories":["Go Generate Tools","Go","Go 代码生成工具","Go 生成工具","Libraries for creating HTTP middlewares"],"sub_categories":["Routers","代码分析","路由器","Search and Analytic Databases"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuri%2Fxgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuri%2Fxgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuri%2Fxgen/lists"}