[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Problem with Key element in xml schema
Hi, Find attached the schemas and the instance documents. I am using MSXML 4.0 parser. The validation goes through successfully even though there are duplicate keys in the instance document. Detailed problem description: 1. I have defined a key for Elem2 which is a global element defined in GlobalElems.xsd. 2. SubMain.xsd included GlobalElems.xsd. 3. SubMainExtend1.xsd and SubMainExtend2.xsd extend from SubMain.xsd. 4. MainSchema.xsd is the main schema on which the instance document is based. This schema imports SubMain.xsd and defines an element SubMain which is of SubMainType. 5. Instance document has two instances of SubMain - SubMainExtend1 and SubMainExtend2 identified based on xsi:type. Duplicate key validation doesn't when SubMain instances are of different types i.e <SubMain xsi:type="submainextend1:SubMainExtend1Type"> <SubMain xsi:type="submainextend2:SubMainExtend2Type">. But the validation happens and a duplicate key found error message is displayed when SubMain instance is of the same type i.e <SubMain xsi:type="submainextend1:SubMainExtend1Type"> <SubMain xsi:type="submainextend1:SubMainExtend1Type">. This problem occurs only when a restriction is applied to the primary key element. What could be the reason??? TIA. Avinash Subramanya Developer Aztec Software And Technology Services Limited 23, 3rd 'A' Cross, 18th Main, 6th Block, Koramangala Bangalore - 560095, India Phone: 5522892/93 Ext: 205 Fax: 91-80-5521987 Mobile: 98441 29329 <<GlobalElems.xsd>> <<MainSchema.xsd>> <<SubMainExtend1.xsd>> <<SubMainExtend2.xsd>> <<SubMain.xsd>> <<InstanceDoc.xml>> Avinash Subramanya Developer Aztec Software And Technology Services Limited 23, 3rd 'A' Cross, 18th Main, 6th Block, Koramangala Bangalore - 560095, India Phone: 5522892/93 Ext: 205 Fax: 91-80-5521987 Mobile: 98441 29329
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|