Hi Ilya,
I think the limitation here is that the reuse is happening at the XSD level, but not at the Mendix Export Mapping level.
Your XSD approach with reusable xs:complexType is perfectly valid. However, when the XSD is used to create an Export Mapping, Mendix treats the selected schema structure as part of that mapping. There isn't currently a mechanism to define a reusable child Export Mapping and reference it from multiple parent Export Mappings.
So if the same complex element occurs in 10 places, the corresponding mapping configuration has to be maintained in those places.
One thing I would consider is to keep the XSD as the single source of truth and avoid modifying the generated mapping XML manually. Mendix expects the export mapping to correspond to the imported XML schema, and the generated XML also has to follow the XSD structure and ordering.
For the specific problem you describe, I would look at reducing the amount of mapping duplication rather than trying to make the mapping itself modular.
For example, if the repeated element has the same structure everywhere, you can:
complexType.The mapping itself can retrieve objects by association, by microflow, or from the mapping parameter, so the data retrieval logic can be reused even though the visual mapping definition cannot.
Another option, depending on your integration design, is to split the integration into separate exports. Mendix's Export with mapping activity allows you to explicitly select an Export Mapping and pass its required parameter.
But if the requirement is specifically:
DefineElementA→ElementA_Mappingonce and then reference that mapping from 10 different parent mappings
then I don't believe Mendix currently provides that as a supported Export Mapping feature.
I would also avoid manually editing the .xml representation of the Export Mapping. It may work temporarily, but it is not a good maintenance approach because the mapping is a model document managed by Studio Pro.
So unfortunately, for a large schema with heavily reused complex types, the XSD can be modular, but the Mendix Export Mapping itself still requires the mapping structure to be defined in each location.
This is one of those cases where the limitation becomes quite noticeable with large XSDs.