All Projects β†’ RReverser β†’ Serde Xml Rs

RReverser / Serde Xml Rs

Licence: mit
xml-rs based deserializer for Serde (compatible with 1.0+)

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Serde Xml Rs

serde
🚝 (unmaintained) A framework for defining, serializing, deserializing, and validating data structures
Stars: ✭ 49 (-65.25%)
Mutual labels:  serde, deserialization
ofxgo
Golang library for querying and parsing OFX
Stars: ✭ 96 (-31.91%)
Mutual labels:  parsing, xml
kafka-protobuf-serde
Serializer/Deserializer for Kafka to serialize/deserialize Protocol Buffers messages
Stars: ✭ 52 (-63.12%)
Mutual labels:  serde, deserialization
avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (-69.5%)
Mutual labels:  serde, deserialization
Fuzi
A fast & lightweight XML & HTML parser in Swift with XPath & CSS support
Stars: ✭ 894 (+534.04%)
Mutual labels:  xml, parsing
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-82.27%)
Mutual labels:  serde, deserialization
libcitygml
C++ Library for CityGML Parsing and Visualization
Stars: ✭ 69 (-51.06%)
Mutual labels:  parsing, xml
dataconf
Simple dataclasses configuration management for Python with hocon/json/yaml/properties/env-vars/dict support.
Stars: ✭ 40 (-71.63%)
Mutual labels:  parsing, deserialization
Marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes.
Stars: ✭ 5,857 (+4053.9%)
Mutual labels:  serde, deserialization
Quick Xml
Rust high performance xml reader and writer
Stars: ✭ 480 (+240.43%)
Mutual labels:  xml, deserialization
Parse Xml
A fast, safe, compliant XML parser for Node.js and browsers.
Stars: ✭ 184 (+30.5%)
Mutual labels:  xml, parsing
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (-21.28%)
Mutual labels:  serde, deserialization
Cbor
CBOR support for serde.
Stars: ✭ 238 (+68.79%)
Mutual labels:  serde, parsing
sexp-grammar
Invertible parsing for S-expressions
Stars: ✭ 28 (-80.14%)
Mutual labels:  parsing, deserialization
Node Xml2js
XML to JavaScript object converter.
Stars: ✭ 4,402 (+3021.99%)
Mutual labels:  xml, parsing
Xml
No longer maintained
Stars: ✭ 36 (-74.47%)
Mutual labels:  xml, serde
Coregpx
A library for parsing and creation of GPX location files. Purely Swift.
Stars: ✭ 132 (-6.38%)
Mutual labels:  xml, parsing
Oq
A performant, and portable jq wrapper to facilitate the consumption and output of formats other than JSON; using jq filters to transform the data.
Stars: ✭ 132 (-6.38%)
Mutual labels:  xml
Protobuf Java Format
Provide serialization and de-serialization of different formats based on Google’s protobuf Message. Enables overriding the default (byte array) output to text based formats such as XML, JSON and HTML.
Stars: ✭ 134 (-4.96%)
Mutual labels:  xml
Servicemix
Apache ServiceMix
Stars: ✭ 131 (-7.09%)
Mutual labels:  xml

serde-xml-rs

Build Status

xml-rs based deserializer for Serde (compatible with 0.9+)

Usage

Use serde_xml_rs::from_reader(...) on any type that implements std::io::Read as following:

#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_xml_rs;

use serde_xml_rs::from_reader;

#[derive(Debug, Deserialize)]
struct Item {
    pub name: String,
    pub source: String
}

#[derive(Debug, Deserialize)]
struct Project {
    pub name: String,

    #[serde(rename = "Item", default)]
    pub items: Vec<Item>
}

fn main() {
    let s = r##"
        <Project name="my_project">
            <Item name="hello" source="world.rs" />
        </Project>
    "##;
    let project: Project = from_reader(s.as_bytes()).unwrap();
    println!("{:#?}", project);
}

Alternatively, you can use serde_xml_rs::Deserializer to create a deserializer from a preconfigured xml_rs::EventReader.

Parsing the "value" of a tag

If you have an input of the form <foo abc="xyz">bar</foo>, and you want to get at thebar, you can use the special name $value:

struct Foo {
    pub abc: String,
    #[serde(rename = "$value")]
    pub body: String,
}

Parsed representations

Deserializer tries to be as intuitive as possible.

However, there are some edge cases where you might get unexpected errors, so it's best to check out tests for expectations.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].