redefine a complexType

Hi All,
We have recently started to look at XML schemas as alternatives to DTDs in
our product. I had a simple query regarding the <redefine> element , as it
applies to extending a complexType.
 
I am trying to 'extend' a complexType , which is defined in the base schema
. The following are the simplified versions of my parent and child schemas:
 
Parent.xsd
--------------
.....
<complexType name="foo">
    <choice maxOccurs="unbounded">
        <element ref="a"/>
        <element ref="b"/>
        <element ref="c"/>
    <choice>
</complexType>
.......        
###########################
Child.xsd
---------------
.....
<redefine schemaLocation=Parent.xsd">
    <complexType name="foo">
        <complexContent>
            <extension base="foo">
                <choice maxOccurs="unbounded">
                    <element ref="d"/>
                    <element ref="e"/>
                <choice>
            </extension>
        </complexContent>
    </complexType>
</redefine>
.......        
 
So , I basically want to redefine the complexType "foo" to allow elements of
type "d" and "e" in addition to "a" , "b" and "c".
 
Then I have a simple instance document which looks like 
<foo> 
    <a> .... </a>
    <b> .... </b>
    <d> .... </d>
</foo>
 
 
When I refer to the child schema from this instance document and run it
through Xerces 2.3.0 for validation against the schema , I get an error
message of type "Invalid content starting with 'a' . One of 'd' is
expected." From the error message , it is clear that the redefinition above
actually did not inherit the elements from the parent.
 
Can you spot where the error might be ?
 
Thanks in advance,
-- Navneet
  

Received on Saturday, 3 May 2003 18:36:59 UTC