GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • polyxml/PolyXML
  • Overview
  • Quickstart
  • Playground
  • Why PolyXML?
  • Languages
  • Rust
  • Python
  • TypeScript & Node.js
  • WebAssembly
  • Go
  • C++20
  • Java
  • C#

This view

  • Original page
  • New address

GeezerVison is showing polyxml.github.io — Languages - PolyXML

Languages#

Choose the ecosystem you are using:

  • Rust
  • Python
  • C++20
  • Go
  • TypeScript and Node.js
  • WebAssembly
  • Java
  • C#

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; topological chunking with --split-units
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); standalone XML codecs (--feature direct-codec); 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; standalone XML codecs (--feature direct-codec)
WebAssembly Browser, Edge & Node runtime (@polyxml/wasm) Streaming parseStream, schema validation, zero-dependency Wasm
Java Java records POJOs, builders, direct XML codecs, Jackson 2/3, Spring Boot 4
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.

Serialization with generated models#

Each guide includes a path from XSD generation to serialization. Rust Serde is specific to Rust; other languages use their own runtimes and model metadata.

Target XML with generated models JSON with generated models
Rust Generated quick-xml methods Serde derives and serde_json
Python PolyXML runtime and generated helpers PolyXML runtime and generated helpers
Go encoding/xml, emitted tags/methods encoding/json, emitted tags
C# XmlSerializer, emitted attributes/proxies System.Text.Json
Java Jackson XML or opt-in direct StAX codecs Jackson
C++ Standalone codecs (--feature direct-codec) or native binding Optional Glaze metadata
TypeScript Standalone codecs (--feature direct-codec) or native binding JSON APIs; optional generated validation

By default, C++ and TypeScript generate model types without XML codecs to keep compilation fast on huge schemas; pass --feature direct-codec (or --codecs) to emit self-contained XML serializers and deserializers directly on the generated models, or wire them through the native runtime bindings. Round-trip support depends on the schema features a backend supports; these examples do not establish full XSD conformance.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.