The particle of the type is not a valid restriction of the particle of the base.
Shai Gotlib <[email protected]>
| Newsgroups | gmane.text.xml.schema.devel |
|---|---|
| Message-ID | <A1AEFA9A6C00D44AB20FC0B1EF0BB6060107B6261218@ILRAAMAIL1.corp.amdocs.com> |
Hi, I Would like to understand what do I do wrong (or the <oXygen> wrong) - please help. I tried to define a restricted complexType. If I do it in the same file were the base file was defined - it is ok. Whenever I move the restriction definition to other xsd file (and import the source file) I fail with: "Error for type 'RestrictedPurchaseOrderTypeAA'. The particle of the type is not a valid restriction of the particle of the base." Enclosed: * transactionSchemaFull.xsd that includes 'RestrictedPurchaseOrderTypeA' - pass validation. * BCMObjects.xsd that includes 'RestrictedPurchaseOrderTypeAA' - validation fail Notice - 'RestrictedPurchaseOrderTypeAA' is identical to 'RestrictedPurchaseOrderTypeA' Thanks in advance, Shai This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at http://www.amdocs.com/email_disclaimer.asp
BCMObjects.xsd
(text/xml, 829 B)
<?xml version="1.0" encoding="ISO-8859-1"?> <xs:schema targetNamespace="http://bcmobject" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bcm="http://bcmobject" xmlns:tr="http://www.example.com/TR"> <xs:import namespace="http://www.example.com/TR" schemaLocation="Y:\XP Documents\BCM\Simple Example - BCM Concept\transactionSchemaFull.xsd"/> <xs:complexType name="RestrictedPurchaseOrderTypeAA"> <xs:complexContent> <xs:restriction base="tr:purchaseOrder"> <xs:sequence> <xs:element name="billTo" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="comment" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="shipTo" type="xs:string" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:schema>
transactionSchemaFull.xsd
(text/xml, 2.6 KB)
<?xml version="1.0" encoding="ISO-8859-1"?> <xs:schema targetNamespace="http://www.example.com/TR" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tr="http://www.example.com/TR" elementFormDefault="qualified"> <xs:complexType name="transaction"> <xs:sequence> <xs:element name="transactionID" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="purchaseOrder" type="tr:purchaseOrder" minOccurs="1" maxOccurs="1"/> </xs:sequence> <xs:attribute name="orderDate" use="optional" type="xs:string"/> </xs:complexType> <xs:complexType name="purchaseOrder"> <xs:sequence> <xs:element name="billTo" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="comment" type="xs:string" minOccurs="0" maxOccurs="1"/> <xs:element name="shipTo" type="xs:string" minOccurs="1" maxOccurs="1"/> </xs:sequence> <xs:attribute name="orderDate" use="optional" type="xs:string"/> </xs:complexType> <xs:complexType name="RestrictedTransactionTypeA"> <xs:complexContent> <xs:restriction base="tr:transaction"> <xs:sequence> <xs:element name="transactionID" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="purchaseOrder" type="tr:RestrictedPurchaseOrderTypeA" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="RestrictedTransactionTypeB"> <xs:complexContent> <xs:restriction base="tr:transaction"> <xs:sequence> <xs:element name="transactionID" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="purchaseOrder" type="tr:RestrictedPurchaseOrderTypeB" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="RestrictedPurchaseOrderTypeA"> <xs:complexContent> <xs:restriction base="tr:purchaseOrder"> <xs:sequence> <xs:element name="billTo" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="comment" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="shipTo" type="xs:string" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="RestrictedPurchaseOrderTypeB"> <xs:complexContent> <xs:restriction base="tr:purchaseOrder"> <xs:sequence> <xs:element name="billTo" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="shipTo" type="xs:string" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:schema>