-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Hello,
I am trying to use this XSD file :
https://standards.iso.org/iso/15143/-3/ed-1/en/common.xsd
I was able to debug the problem to smallest example:
main.rs
use xml_schema_derive::XmlSchema;
fn main() {
#[derive(Debug, XmlSchema,Default)]
#[xml_schema(source = "test_pass.xsd",store_generated_code="output")]
struct Test;
}
test_pass.xsd
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0.0"
>
<xs:element name="my_type2">
<xs:complexType>
<xs:sequence>
<xs:element name="member" type="string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="my_type">
<xs:complexType>
<xs:sequence>
<xs:element name="member" type="string" />
<xs:element name="my_type2" type="my_type2"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
test_fail.xsd
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0.0"
>
<xs:element name="my_type">
<xs:complexType>
<xs:sequence>
<xs:element name="member" type="string" />
<xs:element name="my_type2">
<xs:complexType>
<xs:sequence>
<xs:element name="member" type="string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
with test_fail.xsd i get error
error[E0412]: cannot find type `my_type2` in this scope
--> src/main.rs:7:21
|
7 | #[derive(Debug, XmlSchema,Default)]
| ^^^^^^^^^ not found in this scope
|
= note: this error originates in the derive macro `XmlSchema` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0412`.
One could think that these two result to same code?
Metadata
Metadata
Assignees
Labels
No labels