EDN Admin
Well-known member
I am compiling a xsd file using SOM and getting the error "Invalid particle derivation by restriction - Derived element Inventory_Detail_List is not a valid restriction of base element Inventory_Detail_List according to Elt:Elt -- NameAndTypeOK.."
I also noticed that when i open the same file in visual stodio 2010, I get the same error. There is no error if I open the same xsd file with other tool like xml spy...
I am not sure why visual studio and SOM throwing this error. I have MSXML SP03 installed and here is my XSD file. Any help will be appreciated:
<?xml version = "1.0" encoding = "UTF-8"?>
<!--Generated by Turbo XML. Conforms to w3c http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema -->
<xsd:schema xmlns = http://somename.com/IS/Inventory
http://somename.com/IS/Inventory
targetNamespace = " http://somename.com/IS/Inventory http://somename.com/IS/Inventory "
xmlns:xsd = " http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema "
xmlns:xtd = http://somename.com/IS/XTDataTypes http://somename.com/IS/XTDataTypes
elementFormDefault = "unqualified
<xsd:import namespace = http://somename.com/IS/XTDataTypes
http://somename.com/IS/XTDataTypes schemaLocation = "XTDataTypes.xsd"/>
<!--
W3C XML Schema Generated using Xtelligent Schema generator.
Date: Wed May 5 16:39:26 UTC+0530 2004-->
<xsd:element name = "Inventory" type = "Inventory_Type"/>
<xsd:complexType name ="Inventory_Detail_Type
<xsd:all>
<xsd:element name = "Inventory_Detail_ID" type = "xtd:Number16"/>
<xsd:element name = "Product_ID" type = "xtd:Number16" minOccurs = "0"/>
<xsd:element name = "Lot_Number" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Physical_Quantity" type = "xtd:Number9" minOccurs = "0"/>
<xsd:element name = "SFA_Computed_Quantity" type = "xtd:Number9" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Details_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reason" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Comment" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail" type = "xsd:string"/>
</xsd:complexType>
<xsd:complexType name ="Inventory_Detail_Insert_Type
<xsd:complexContent>
<xsd:restriction base = "Inventory_Detail_Type
<xsd:all>
<xsd:element name = "Inventory_Detail_ID" type = "xtd:Number16"/>
<xsd:element name = "Product_ID" type = "xtd:Number16"/>
<xsd:element name = "Lot_Number" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Physical_Quantity" type = "xtd:Number9"/>
<xsd:element name = "SFA_Computed_Quantity" type = "xtd:Number9" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Details_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reason" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Comment" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail" type = "xsd:string"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name = "Inventory_Type
<xsd:all>
<xsd:element name = "Inventory_ID" type = "xtd:Number16"/>
<xsd:element name = "Employee_ID" type = "xtd:Number16" minOccurs = "0"/>
<xsd:element name = "Inventory_Type" type = "xtd:Inventory_Type_Code" minOccurs = "0"/>
<xsd:element name = "Inventory_Subtype" type = "xtd:Inventory_Subtype_Code" minOccurs = "0"/>
<xsd:element name = "Inventory_Date" type = "xtd:dateTimeStringType" minOccurs = "0"/>
<xsd:element name = "Inventory_Document_Value" type = "xtd:String200" minOccurs = "0"/>
<xsd:element name = "Sales_Area_Value" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Sales_Force_Name" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Status_Code" minOccurs = "0"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Performed_By_Name" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Baseline_Inventory_Indicator" type = "xtd:Number1" minOccurs = "0"/>
<xsd:element name = "Comment" type = "xtd:String2000" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Tenant_ID" type = "xtd:String200" minOccurs = "0"/>
<xsd:element name = "Region_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Business_Unit_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Inventory_Detail_List" minOccurs = "0
<xsd:complexType>
<xsd:sequence>
<xsd:element name = "Inventory_Detail" type ="Inventory_Detail_Type" maxOccurs = "unbounded" />
</xsd:sequence>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail_List" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory" type = "xsd:string"/>
</xsd:complexType>
<xsd:complexType name = "Inventory_Insert_Type
<xsd:complexContent>
<xsd:restriction base = "Inventory_Type
<xsd:all>
<xsd:element name = "Inventory_ID" type = "xtd:Number16"/>
<xsd:element name = "Employee_ID" type = "xtd:Number16"/>
<xsd:element name = "Inventory_Type" type = "xtd:Inventory_Type_Code"/>
<xsd:element name = "Inventory_Subtype" type = "xtd:Inventory_Subtype_Code"/>
<xsd:element name = "Inventory_Date" type = "xtd:dateTimeStringType"/>
<xsd:element name = "Inventory_Document_Value" type = "xtd:String200"/>
<xsd:element name = "Sales_Area_Value" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Sales_Force_Name" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Status_Code"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Performed_By_Name" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Baseline_Inventory_Indicator" type = "xtd:Number1"/>
<xsd:element name = "Comment" type = "xtd:String2000" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Tenant_ID" type = "xtd:String200" minOccurs = "0"/>
<xsd:element name = "Region_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Business_Unit_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Inventory_Detail_List" minOccurs = "0
<xsd:complexType>
<xsd:sequence>
<xsd:element name = "Inventory_Detail" type ="Inventory_Detail_Type" maxOccurs = "unbounded" />
</xsd:sequence>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail_List" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory" type = "xsd:string"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
View the full article
I also noticed that when i open the same file in visual stodio 2010, I get the same error. There is no error if I open the same xsd file with other tool like xml spy...
I am not sure why visual studio and SOM throwing this error. I have MSXML SP03 installed and here is my XSD file. Any help will be appreciated:
<?xml version = "1.0" encoding = "UTF-8"?>
<!--Generated by Turbo XML. Conforms to w3c http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema -->
<xsd:schema xmlns = http://somename.com/IS/Inventory
http://somename.com/IS/Inventory
targetNamespace = " http://somename.com/IS/Inventory http://somename.com/IS/Inventory "
xmlns:xsd = " http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema "
xmlns:xtd = http://somename.com/IS/XTDataTypes http://somename.com/IS/XTDataTypes
elementFormDefault = "unqualified
<xsd:import namespace = http://somename.com/IS/XTDataTypes
http://somename.com/IS/XTDataTypes schemaLocation = "XTDataTypes.xsd"/>
<!--
W3C XML Schema Generated using Xtelligent Schema generator.
Date: Wed May 5 16:39:26 UTC+0530 2004-->
<xsd:element name = "Inventory" type = "Inventory_Type"/>
<xsd:complexType name ="Inventory_Detail_Type
<xsd:all>
<xsd:element name = "Inventory_Detail_ID" type = "xtd:Number16"/>
<xsd:element name = "Product_ID" type = "xtd:Number16" minOccurs = "0"/>
<xsd:element name = "Lot_Number" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Physical_Quantity" type = "xtd:Number9" minOccurs = "0"/>
<xsd:element name = "SFA_Computed_Quantity" type = "xtd:Number9" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Details_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reason" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Comment" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail" type = "xsd:string"/>
</xsd:complexType>
<xsd:complexType name ="Inventory_Detail_Insert_Type
<xsd:complexContent>
<xsd:restriction base = "Inventory_Detail_Type
<xsd:all>
<xsd:element name = "Inventory_Detail_ID" type = "xtd:Number16"/>
<xsd:element name = "Product_ID" type = "xtd:Number16"/>
<xsd:element name = "Lot_Number" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Physical_Quantity" type = "xtd:Number9"/>
<xsd:element name = "SFA_Computed_Quantity" type = "xtd:Number9" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Details_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Reason" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Comment" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail" type = "xsd:string"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name = "Inventory_Type
<xsd:all>
<xsd:element name = "Inventory_ID" type = "xtd:Number16"/>
<xsd:element name = "Employee_ID" type = "xtd:Number16" minOccurs = "0"/>
<xsd:element name = "Inventory_Type" type = "xtd:Inventory_Type_Code" minOccurs = "0"/>
<xsd:element name = "Inventory_Subtype" type = "xtd:Inventory_Subtype_Code" minOccurs = "0"/>
<xsd:element name = "Inventory_Date" type = "xtd:dateTimeStringType" minOccurs = "0"/>
<xsd:element name = "Inventory_Document_Value" type = "xtd:String200" minOccurs = "0"/>
<xsd:element name = "Sales_Area_Value" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Sales_Force_Name" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Status_Code" minOccurs = "0"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Performed_By_Name" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Baseline_Inventory_Indicator" type = "xtd:Number1" minOccurs = "0"/>
<xsd:element name = "Comment" type = "xtd:String2000" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Tenant_ID" type = "xtd:String200" minOccurs = "0"/>
<xsd:element name = "Region_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Business_Unit_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Inventory_Detail_List" minOccurs = "0
<xsd:complexType>
<xsd:sequence>
<xsd:element name = "Inventory_Detail" type ="Inventory_Detail_Type" maxOccurs = "unbounded" />
</xsd:sequence>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail_List" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory" type = "xsd:string"/>
</xsd:complexType>
<xsd:complexType name = "Inventory_Insert_Type
<xsd:complexContent>
<xsd:restriction base = "Inventory_Type
<xsd:all>
<xsd:element name = "Inventory_ID" type = "xtd:Number16"/>
<xsd:element name = "Employee_ID" type = "xtd:Number16"/>
<xsd:element name = "Inventory_Type" type = "xtd:Inventory_Type_Code"/>
<xsd:element name = "Inventory_Subtype" type = "xtd:Inventory_Subtype_Code"/>
<xsd:element name = "Inventory_Date" type = "xtd:dateTimeStringType"/>
<xsd:element name = "Inventory_Document_Value" type = "xtd:String200"/>
<xsd:element name = "Sales_Area_Value" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Sales_Force_Name" type = "xtd:String100" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Status" type = "xtd:Inventory_Status_Code"/>
<xsd:element name = "Reconciliation_Status" type = "xtd:Reconciliation_Status_Code" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Performed_By_Name" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Baseline_Inventory_Indicator" type = "xtd:Number1"/>
<xsd:element name = "Comment" type = "xtd:String2000" nillable = "true" minOccurs = "0"/>
<xsd:element name = "External_ID_1" type = "xtd:String200" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Tenant_ID" type = "xtd:String200" minOccurs = "0"/>
<xsd:element name = "Region_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Business_Unit_ID" type = "xtd:Number16" nillable = "true" minOccurs = "0"/>
<xsd:element name = "Inventory_Detail_List" minOccurs = "0
<xsd:complexType>
<xsd:sequence>
<xsd:element name = "Inventory_Detail" type ="Inventory_Detail_Type" maxOccurs = "unbounded" />
</xsd:sequence>
<xsd:attribute name = "type_name" fixed = "Inventory_Detail_List" type = "xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
<xsd:attribute name = "operation" default = "NONE" type = "xtdperationType"/>
<xsd:attribute name = "objectId" type = "xsd:string"/>
<xsd:attribute name = "type_name" fixed = "Inventory" type = "xsd:string"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
View the full article