Hi, i am still sure that Xerces has a bug with derivation by restriction, as i wrote 16/17 Juni. Once more example :-) <xs:complexType name="basis_test_typ"> <xs:attribute name="V"/> </xs:complexType>
and my derived type: <xs:complexType name="derived_test_typ"> <xs:complexContent> <xs:restriction base="basis_test_typ"> <xs:sequence> <xs:element name="not_allowed_element"/> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> I don't have problems with the attribute, i know that i don't have to repeat them. I have problem with "not_allowed_element". "basis_test_typ" has only definition of one attribute without elements. My "derived_test_typ" has suddenly one element. As i know derived types must be subset of basis types. Element "not_allowed_element" is in fact not allowed here, we have invalid code here. But Xerces (version 2.6.2) doesn't recognize any mistake. You can try yourself with Xerces-examples which are included in Xerces-Package ("DOM/Writer.java"). Somebody wrote me that his Xerces-Parser recognizes wrong derivation, but i couldn't reach this with my Parser. I have all properties on ("schema-checking", "full-schema-checking" and so on...) Now back to the problem with derivation by restriction and <any> Element. I am not so fimilar with W3C specs and my english is also bad. May be somebody else can tell me whether my example below correct is or not. Either microsoft msxml4 or Xerces have here Problem. Thanks for quickly respond Sandy Evgeny -----Ursprüngliche Nachricht----- Von: Sandy Gao [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 8. Juli 2004 17:16 An: [EMAIL PROTECTED] Betreff: Re: Problem with derivation by restriction with <any> Element The position of W3C is the position of Xerces, unless Xerces has a bug. :-) Carefully following the constraints in section 3.9.6 of the schema spec part 1 [1], I believe your example is valid. Note that the sequence around <xs:any> is pointless. [1] http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict > ... but as i previously wrote Xerces-Parser don't recognize invalid > derivation by restriction. You mean the message you sent on June 16/17? Apparently that was valid too. You don't have to repeat all the attributes in a complex type derived by restriction. Attributes from the base type are automatically inherited. Hope this helps, Sandy Gao Software Developer, IBM Canada (1-905) 413-3255 [EMAIL PROTECTED] "Usorov, Evgeny" <[EMAIL PROTECTED]> wrote on 07/08/2004 10:17:37 AM: > Hallo, > > Waht is the position, point of view of W3C with derivation by > restriction of <any> Element? The situation is: > I have an schema, that i want to restrict. At one place schema is > open and has an Element where <any> Element with > maxOccur="unbounded" is defined. I want to define two Elements > ("foo" and "bar")instead of the any-deklaration. For example: > > <xs:complexType name="basis_test_typ"> > <xs:sequence> > <xs:any maxOccurs="unbounded"/> > </xs:sequence> > </xs:complexType> > > my derived Type: > <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:sequence> > </xs:restriction> > </xs:complexContent> > </xs:complexType> > > > so with two defined elements i get error-message from Microsoft > msxml4. With Xerces-Parser (verion 2.6.2) i get no error-message, > but as i previously wrote Xerces-Parser don't recognize invalid > derivation by restriction. With declaration of only one element > ("foo") i don't get errors. Does everybody knows, what is the > position, point of view of W3C ? Are Microsoft errors correct ? > > > 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]