How to import a complex XSD?

1
When importing complex XSD's that import other XSD's, I receive the following error when trying to import it into Mendix: Error: "Type 'http://www.w3.org/2000/09/xmldsig#:CryptoBinary' is not declared, or is not a simple type." at line 52 column 6 of 'file:///C:/xsd/common/UBL-xmldsig11-schema-2.2.xsd'. Any practices to solve this issue?
asked
1 answers
1

For example:

I have my first main.xsd that I import in my modeler:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:ns="http://www.url.nl/ns1" targetNamespace="http://schemas.xmlsoap.org/soap/envelope" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:import schemaLocation="GetCase.xsd" namespace="http://www.url.nl/ns1" />
    <xs:element name="Envelope">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Body" type="ns:ns" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

 

This imports this one:

 

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:ins="http://www.url.nl/ns2" targetNamespace="http://www.url.nl/ns1" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:import schemaLocation="getResult.xsd" namespace="http://www.url.nl/ns2" />
    <xs:complexType name="ns">
        <xs:sequence>
            <xs:element name="getResponse">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="getResult" type="ins:insp" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

 

and that one imports another one...

 

It takes a bit of fiddling to get it to work. Make sure you add schemaLocation="sub.xsd" in your main.xsd. Also notice that the type of the main.xsd matches the complex type of the sub.

Hopefully this helps

answered