W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2002

how can I extend a schema?? need help, please.

From: mehdi bennani <mehdibennani@hotmail.com>
Date: Wed, 03 Apr 2002 14:04:11 -0500
Message-Id: <5.1.0.14.1.20020403140403.0241a300@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Hi there,

I have this core schema (Core.xsd) that describes a transport problem. It 
only contains some basic elements and complex-types and it is actually 
meant to be a base to extend from. Now my problem is this:
How can I extend this Core.xsd schema, in say CoreExt1.xsd, by adding new 
elements and new types, derive from core-types and refer to these core 
elements without actually modifying/altering the core schema in this 
operation (all changes to be made are in the CoreExt1.xsd).

I have tried using <xsd:redefine> to redefine the core complex-types, and 
it all worked fine for me until I needed to set some of the attributes (say 
Attribute A) newly defined in the new CoreExt1.xsd as unique 
(<xsd:unique>). The problem I run into is that the <xsd:unique> tag for, 
say attribute A (defined in the complex-type `someNewType`), cannot be 
defined inside the element that contains that attribute (`containingA` 
element). And, instead, it has to be defined in a parent of that element. 
(basically a scope problem)
<xsd:element name="containingA" type="someNewType">
     <xsd:unique name="UniqA">
          <xsd:selector xpath="." />
           <xsd:field xpath="@A" />
     </xsd:unique>
</xsd:element>
(Note: I also thought of changing the selector xpath to 
".//MyNamespace:Rootparent". It won't work!)

Unfortunately, I don't have access to that parent element, while using 
redefine. (The same problem is encountered when using <xsd:key> !!)

There might be a way around it using <redefine> ( I wish I could find it !) 
, but It has to be also a way of extending an XSD and being able to access 
all the elements in that XSD from within a new XSD.

Thank you for your help.

Mehdi Bennani
Soft. Eng

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx
Received on Wednesday, 3 April 2002 14:07:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:00 GMT