PolyXML CLI (polyxml)
Unified developer command-line interface and polyglot schema compiler toolchain for PolyXML.
polyxml parses W3C XSD 1.0 and 1.1 schemas into a unified, language-agnostic Intermediate Representation (IR), resolves cyclic/recursive types via Tarjan's Strongly Connected Components (SCC) algorithm, and compiles production-ready, idiomatic data models and codecs for 7 target languages.
Installation
1. Universal One-Line Installer (Linux & macOS)
|
2. Direct Packages (Debian / Ubuntu & Fedora / RHEL)
Download pre-built packages from GitHub Releases:
# Debian / Ubuntu / Mint / Pop!_OS (.deb)
# Fedora / RHEL / Rocky Linux / openSUSE (.rpm)
3. Homebrew (macOS & Linux)
4. Cargo / Cargo-Binstall
# Fast pre-compiled binary via binstall
# Or compile from source
Supported Target Languages
| Target | Flag (--lang) |
Generated Artifacts & Features |
|---|---|---|
| Python | python |
Modern Python 3.12+ @dataclass or Pydantic v2 models, field constraints, zero-copy streaming codecs |
| Rust | rust |
Zero-copy Cow<'a, str> & owned structs, automatic recursive boxing (Box<T>), streaming serializers/deserializers, rkyv wire format (--feature rkyv) |
| C++ | cpp |
Modern C++20/C++23 value types, C++20 Modules (--mode modules), Glaze reflection (--backend glaze), CMake/Meson export |
| Java | java |
Java 22+ records or mutable JavaBeans (--style pojo), fluent builders (--feature builder), direct StAX codecs (--feature direct-codec), Jackson XML/JSON annotations (--backend jackson) |
| TypeScript | typescript |
TypeScript 5+ interfaces, discriminated unions, runtime validation schemas via Zod, Valibot, or TypeBox (--backend) |
| Go | go |
Idiomatic Go 1.22+ structs with encoding/xml tags, reflectionless EasyJSON (--backend easyjson) & ByteDance Sonic JIT (--backend sonic) |
| C# | csharp |
Modern C# 12 / .NET 8+ mutable classes (--style class), records and record structs (--style record-struct), compile-time Native AOT source generation (--backend source-gen) |
Commands
1. polyxml generate
Compile schemas directly into code for one or more target languages:
# Generate Python dataclasses
# Generate Pydantic v2 models with runtime validation
# Generate Java 22 records with Enterprise Jackson annotations
# Generate C++20 Modules with Glaze reflectionless serde
# Generate zero-copy Rust models with codecs and rkyv wire format
# Generate TypeScript with tree-shakeable Valibot schemas
# Generate Go models with ByteDance Sonic JIT tags
# Generate C# record structs with Native AOT source generation
# Multi-target compilation in a single invocation
# Dry-run inspection without writing files to disk
2. polyxml build
Build an entire multi-target, multi-schema project declaratively from a polyxml.toml workspace manifest:
3. polyxml validate
Statically check W3C XML schemas for structural validity, element types, and cycle topology:
Workspace Manifest (polyxml.toml)
[]
= "enterprise-data-pipeline"
= ["schemas/iso20022/*.xsd"]
= ["schemas/common/"]
= "./generated"
[[]]
= "python"
= "src/generated/python"
= "pydantic"
= true
[[]]
= "rust"
= "src/generated/rust"
= ["zero-copy", "rkyv"]
= true
[[]]
= "java"
= "src/generated/java"
= "com.enterprise.banking.iso20022"
= "jackson"
[[]]
= "typescript"
= "src/generated/ts"
= "valibot"
[[]]
= "cpp"
= "src/generated/cpp"
= "modules"
= "glaze"
[[]]
= "go"
= "src/generated/go"
= "payments"
= "sonic"
[[]]
= "csharp"
= "src/generated/csharp"
= "Enterprise.Banking.Iso20022"
= "source-gen"
= "record-struct"
🌐 Production Reference Repositories
Explore full-scale repositories using PolyXML CLI manifests across all 7 languages:
- 🛸 Defense & Aerospace: Anduril Lattice SDK ↔ USAF UCI v2.5 XML (includes PyO3 AOT native extension)
- 💳 FinTech & Banking: Instant Payments ↔ ISO 20022 pacs.008 XML
- 🚍 Smart Cities & Transit: Google GTFS-Realtime ↔ CEN SIRI v2.0 & NeTEx XML
Shell completion
Run polyxml completions bash, polyxml completions zsh, or
polyxml completions fish to generate a shell script. Backend, style, and feature
suggestions are filtered by the selected language(s). See the
compiler guide for installation.