Languages¶
Choose the ecosystem you are using:
For shared CLI options and code generation, see the schema compiler guide.
Choose a starting point¶
All seven targets can generate models from XSD with polyxml generate. The default backend is the recommended starting point; enable the extras only when your project needs them. Use a separate [[generate]] entry per target in polyxml.toml when options differ between languages.
| Target | Default generated models | Optional code generation |
|---|---|---|
| Rust | Native Rust types with streaming XML codecs | phf dispatch; owned strings with --zero-copy=false |
| Python | Dataclasses with slots and keyword-only fields | Pydantic v2 backend; slots and kw-only for dataclasses |
| C++20 | Header-based types | C++ modules (--mode modules); Glaze metadata |
| Go | Go structs with XML and JSON tags | EasyJSON annotations; Sonic tags (see the current limitation) |
| TypeScript / Node.js | TypeScript interfaces | Zod, Valibot, or TypeBox schemas |
| Java | Java records | POJOs, builders, direct XML codecs, Jackson backend |
| C# | Record classes | Mutable classes, record structs, source generation |
The compiler guide lists the exact backend, style, and feature values accepted by the CLI. For parsing and serialization from application code, start with your language guide. For command-line generation, validation, builds, and transcoding, start with the compiler guide.