A pure Go library for parsing XSD files and generating type-safe code in Go, C, Java, Rust, and TypeScript.
xgen is a library and command-line tool that parses XML Schema Definition (XSD) files and automatically generates corresponding type-safe class or struct declarations in multiple programming languages. It automates the creation of data structures from XML schemas, reducing manual coding errors and improving developer productivity when working with XML-based data formats.
Developers and engineers who need to programmatically interact with XML data validated by XSD schemas, particularly those working in Go, C, Java, Rust, or TypeScript and seeking to avoid manually writing type definitions.
Developers choose xgen for its multi-language code generation from a single tool, its adherence to W3C XML Schema standards ensuring reliable output, and its extensible hook system that allows deep customization of the parsing and code generation process.
XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates type-safe code for Go, C, Java, Rust, and TypeScript from XSD, enabling consistent data structures across different tech stacks, as highlighted in the key features.
Provides a Go library for fine-grained control over parsing and code generation, allowing integration into custom workflows, as shown in the programmatic usage example.
Supports hook interfaces to intercept parsing events and customize generated code, useful for handling vendor-specific annotations or injecting methods, detailed in the customization section.
Command-line tool allows processing directories of XSD files with configurable output options, streamlining code generation for multiple schemas, as demonstrated in the usage instructions.
Requires Go 1.23.0 or later for installation and programmatic use, which can be a barrier for teams not already in the Go ecosystem, adding unnecessary dependency.
Customizing with hooks involves implementing multiple methods in Go, which can be verbose and requires deep understanding of the library's internals, as seen in the hook interface documentation.
Focuses solely on W3C XSD standards without support for other schema languages like JSON Schema, limiting its utility in mixed or modern API environments.