[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem with Key element in xml schema

  • To: xml-dev@l...
  • Subject: Problem with Key element in xml schema
  • From: Avinash Subramanya <avinashs@a...>
  • Date: Wed, 19 Mar 2003 14:05:11 +0530

xml key element
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

GlobalElems.xsd

MainSchema.xsd

SubMainExtend1.xsd

SubMainExtend2.xsd

SubMain.xsd

InstanceDoc.xml


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.