Hi Tomas, I'm not familiar enough with the XML Signature xsds to comment on what you need to change to make this work. However from the error message, rcase-Recurse.2, I know that I can find more information about the error at the URL below. http://www.w3.org/TR/xmlschema-1/#rcase-Recurse
The following is from that section of the schema spec and, my guess is you might be missing some required elements from the restriction. Schema Component Constraint: Particle Derivation OK (All:All,Sequence:Sequence -- Recurse) For an all or sequence group particle to be a ·valid restriction· of another group particle with the same {compositor} all of the following must be true: 1 R's occurrence range is a valid restriction of B's occurrence range as defined by Occurrence Range OK (§3.9.6). 2 There is a complete ·order-preserving· functional mapping from the particles in the {particles} of R to the particles in the {particles} of B such that all of the following must be true: 2.1 Each particle in the {particles} of R is a ·valid restriction· of the particle in the {particles} of B it maps to as defined by Particle Valid (Restriction) (§3.9.6). 2.2 All particles in the {particles} of B which are not mapped to by any particle in the {particles} of R are ·emptiable· as defined by Particle Emptiable (§3.9.6). Note: Although the ·validation· semantics of an all group does not depend on the order of its particles, derived all groups are required to match the order of their base in order to simplify checking that the derivation is OK. [Definition:] A complete functional mapping is order-preserving if each particle r in the domain R maps to a particle b in the range B which follows (not necessarily immediately) the particle in the range B mapped to by the predecessor of r, if any, where "predecessor" and "follows" are defined with respect to the order of the lists which constitute R and B. Hope this helps, -Jacob Danner On 4/25/07, Tomas Barros <[EMAIL PROTECTED]> wrote:
Hi, I need to add some restrictions on the XML SIgnature standard (Actually to force some optional fields), which involves restrictions inside the elements of the Signature complex type. For instance: <xs:complexType name="SignatureType"> <xs:complexContent> <xs:restriction base="ds:SignatureType"> <xs:sequence> <xs:element name="SignedInfo" type="SignedInfoType"/> <xs:element ref="ds:SignatureValue" /> <xs:element ref="ds:KeyInfo" minOccurs="1" maxOccurs="1" /> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> <xs:complexType name="SignedInfoType"> <xs:complexContent> <xs:restriction base="ds:SignedInfoType"> <xs:sequence> <xs:element ref="ds:CanonicalizationMethod"/> <xs:element ref="ds:SignatureMethod" /> <xs:element ref="ds:Reference" maxOccurs="unbounded" /> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> But when I try to generate the java files with xmlbeans I get the error: � [xmlbean] schemas/SiiTypes_v10_modified_NIC.xsd:1102:2: error: rcase-Recurse.2: Invalid Restriction. The following particles of the derived <sequence> cannot be mapped to the base <sequence>'s particles: <element name="[EMAIL PROTECTED]://www.sii.cl/SiiDte">, <element name="[EMAIL PROTECTED]://www.w3.org/2000/09/xmldsig#">, <element name="[EMAIL PROTECTED]://www.w3.org/2000/09/xmldsig#"> (by the way, the target namespace I'm doing is http://www.sii.cl/SiiDte) Any ideas to do it in the right way please ? I've looking for a solution in the web but I cannot find any useful information. Thanks a lot in advance for your comments. Tom�s� PS: The next example also fails with the same error. <xs:complexType name="SignatureType"> <xs:complexContent> <xs:restriction base="ds:SignatureType"> <xs:sequence> <xs:element name="SignedInfo"> <xs:complexType> <xs:complexContent> <xs:restriction base="ds:SignedInfoType"> <xs:sequence> <xs:element ref="ds:CanonicalizationMethod" /> <xs:element ref="ds:SignatureMethod" /> <xs:element ref="ds:Reference" maxOccurs="unbounded" /> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType> </xs:element> <xs:element ref="ds:SignatureValue" /> <xs:element ref="ds:KeyInfo" minOccurs="1" maxOccurs="1" /> </xs:sequence> </xs:restriction> </xs:complexContent> </xs:complexType>