media-io / xml-schema

Generate rust code (structures and enum) from XSD
MIT License
52 stars 29 forks source link

Compilation error: `help: message: not implemented` #4

Open atcol opened 4 years ago

atcol commented 4 years ago

I want to use xml-schema with http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd and I tried with this example:

#[macro_use]
extern crate yaserde_derive;

use log::debug;
use std::io::prelude::*;
use xml_schema_derive::XmlSchema;
use yaserde::{YaDeserialize, YaSerialize};

#[derive(Debug, XmlSchema)]
#[xml_schema(source = "schemas/wms/capabilities_1_3_0.xsd", target_prefix = "wms")]
struct Wms;

fn main() {
    println!("Hello, world!");
}

but I get the following error:

error: proc-macro derive panicked
 --> src/main.rs:9:17
  |
9 | #[derive(Debug, XmlSchema)]
  |                 ^^^^^^^^^
  |
  = help: message: not implemented

My Cargo.toml has:

[dependencies]
yaserde_derive = "0.4.1"
yaserde = "0.4.1"
xml-schema-derive = "0.0.3"
xml-schema = "0.0.3"
xml-rs = "0.8.3"
log = "0.4.8"
bpbp-boop commented 4 years ago

Same issue with https://cwmp-data-models.broadband-forum.org/cwmp-1-2.xsd

Debug:

2020-06-22 12:10:49,752 DEBUG [xml_schema_derive::xsd::complex_type] Struct: start to parse "complexType"
2020-06-22 12:10:49,752 DEBUG [yaserde::de] Fetched StartElement({http://www.w3.org/2001/XMLSchema}xs:complexType, {"": "", "soapenc": "http://schemas.xmlsoap.org/soap/encoding/", "soapenv": "http://schemas.xmlsoap.org/soap/envelope/", "tns": "urn:dslforum-org:cwmp-1-2", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/", "xs": "http://www.w3.org/2001/XMLSchema"})
2020-06-22 12:10:49,752 DEBUG [yaserde::de] Fetched EndElement({http://www.w3.org/2001/XMLSchema}xs:complexType)
2020-06-22 12:10:49,752 DEBUG [yaserde::de] Fetched EndElement({http://www.w3.org/2001/XMLSchema}xs:element)
2020-06-22 12:10:49,753 INFO  [xml_schema_derive::xsd::schema] Generate elements
2020-06-22 12:10:49,753 INFO  [xml_schema_derive::xsd::element] Generate element "fault_code"
error: proc-macro derive panicked
MarcAntoine-Arnaud commented 4 years ago

Hello !

XML-schema still very young and not support all XSD for now. I have to take a look on your XSD to see what is missing to support them.

Marc-Antoine