![Build Status] ![Latest Version] ![Coverage Status]
Generate rust code (structures and enum) from XSD
This project depends to other required libraries to start with, add them to your Cargo.toml
.
- YaSerDe derive
- YaSerDe
- XML-Schema derive
- XML-Schema
- XML-rs
- log
In the entrypoint of your rust project, add these folowing lines:
```rust
extern crate yaserde_derive;
use std::io::prelude::*; use xmlschemaderive::XmlSchema; use yaserde::{YaDeserialize, YaSerialize}; ```
Then implement the XSD using:
```rust
struct MySchema; ```
Remark: the MySchema
don't need to be public. It serve just as support of information.
source: Source of the XSD - XML Schema. It can be local file (related to the root of the project) or an HTTP resource.
targetprefix: The schema not define any prefix. It the targetNamespace
is declared in the schema, this attribute is required.
storegeneratedcode: Optional attribute for debug purpose. It store the generated Rust code into the file - the attribute value is the output filename.
loglevel: To configure the logger level at the the compile time - usefull if the XSD generate some bugs. Values can be error
, warn
, info
, debug
, trace
.
modulenamespacemapping: map a namespace to a Rust module. It can be present many times to map multiple namespaces to different Rust modules.