KB Article #176160
circular schema imports in schema xsd
Problem
-- trying to import a schema containing circular schema imports :
Ex :
extract of the first schema (Canonical_Common.xsd)
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://eurofins.com/Retailer.Canonical.Common/1.0.0" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" targetNamespace="http://eurofins.com/Retailer.Canonical.Common/1.0.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/"
schemaLocation="Common_Serialization.xsd" />
<xs:import namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"
schemaLocation="Common_Arrays.xsd" />
<xs:import namespace="http://eurofins.com/Retailer.Canonical.Order/1.0.0"
schemaLocation="Canonical_Order.xsd" />
...
...
extract of the second schema (Canonical_Order.xsd)
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:tns="http://eurofins.com/Retailer.Canonical.Order/1.0.0" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" elementFormDefault="qualified" targetNamespace="http://eurofins.com/Retailer.Canonical.Order/1.0.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="Canonical_Common.xsd" namespace="http://eurofins.com/Retailer.Canonical.Common/1.0.0" />
...
...
...
-- when importing such kind of XSD (either by using the File -> Import -> Schema or by using New -> Business Document -> XSD), the Bdoc cannot be opened :
"Could not open the editor: An exception was thrown during initialization"
Resolution
* Map Designer < version 2.5.2 SP2 does handle circular references* the workaround is to comment of the circular import and to import the modified schema
<!-- avoid recursive import
<xs:import namespace="http://eurofins.com/Retailer.Canonical.Order/1.0.0"
schemaLocation="Canonical_Order.xsd" />