domain to xml mapping failing when importing xsd (no webservice to be used)

3
Hi, I'm trying to export data from domain to xml without using a webservice but keep getting an error when trying to import the xsd. I've created a test structure and it validates fine (external schema validator) but keeps not being accepted through mendix app. Type of element 'Producers': Not supported in Domain-to-XML mappings. Type of element 'Producer': Not supported in Domain-to-XML mappings. Type of element 'Address': Not supported in Domain-to-XML mappings. When I try to add a mapping-to-xml I'm not able to see any attributes. Anything I should be adding to the xsd? Or in to the modeler?! xsd file below ... <?xml version="1.0" encoding="utf-8" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element nillable="true" name="Producers"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element minOccurs="0" maxOccurs="unbounded" nillable="true" name="Producer" form="unqualified"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element minOccurs="0" nillable="true" type="xsd:integer" name="producerid" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="name" form="unqualified"/> <xsd:element minOccurs="0" maxOccurs="unbounded" nillable="true" name="Address" form="unqualified"> <xsd:complexType> <xsd:sequence minOccurs="0"> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="addressline1" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="addressline2" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="addressline3" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="addressline4" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="addressline5" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="postcode" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="telephone" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="fax" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="emailaddress" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="website" form="unqualified"/> <xsd:element minOccurs="0" nillable="true" type="xsd:string" name="defranumber" form="unqualified"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> LR.
asked
1 answers
6

Remove the minOccurs="0" on the xsd:sequence elements (3x) in your XSD and it will work in Mendix. Removing this in your XSD won't actually change the XML documents described by the schema at all, since all child elements are already optional.

Some XML schema structures are not accepted by Mendix, as they cannot be used by the XML-to-Domain mapping. A good example is xsd:choice, but also xsd:sequence with minOccurs="0" cannot be used.

answered