Why not just use the 'extension' feature?

Your schema would look something like this:

        <xs:complexType name="basis_test_typ">
                <xs:sequence>
                        <xs:element name="foo"/>                
                </xs:sequence>  
        </xs:complexType>

        <xs:complexType name="extended_test_typ">
                <xs:complexContent>
                        <xs:extension base="basis_test_typ">
                                <xs:sequence>
                                        <xs:element name="bar"/>                
                        
                                        <xs:element name="bar2"/>
                                </xs:sequence>
                        </xs:extension>
                </xs:complexContent>            
        </xs:complexType>

The definition of "extended_test_typ" automatically picks up the element "foo". 
 As far as I am aware, there would be no need to specify the "any" element in 
your base type.

Ed

-----Original Message-----
From: Usorov, Evgeny [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 15, 2004 4:42 AM
To: xerces-j-dev@xml.apache.org
Cc: [EMAIL PROTECTED]
Subject: derivation by restriction and <any>-Element


Hi,

why this example is wrong, and i get Xerces 2.6.2 error-messages ?

        <xs:complexType name="basis_test_typ">
                <xs:sequence>
                        <xs:element name="foo"/>                
                        <xs:any namespace="##any" minOccurs="0" 
maxOccurs="unbounded" />
                </xs:sequence>  
        </xs:complexType>

        <xs:complexType name="derived_test_typ">
                <xs:complexContent>
                        <xs:restriction base="basis_test_typ">
                                <xs:sequence>
                                        <xs:element name="foo"/>
                                        <xs:element name="bar"/>                
                        
                                        <xs:element name="bar2"/>
                                </xs:sequence>
                        </xs:restriction>
                </xs:complexContent>            
        </xs:complexType>

[Error] test.xsd:148:42: rcase-Recurse.2: There is not a complete functional 
mapping between the particles.
[Error] test.xsd:148:42: derivation-ok-restriction.5.4.2: Error for type 
'derived_test_typ'.  The particle of the type is not a valid restriction of the 
particle of the base.


Thanks in advance
Evgeny


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to