Re: Redefinition of group, who's correct

Sorry I did not saw answers to questions because I had a problem with my 
mailer.

In Oxygen, I'm using Saxon-EE : No errors.

In XMLSpy, the message is :
The schema doesn't appear to be valid by itself (as a part of another 
schema, it might still be OK).
     'essai' is already declared in schema document 'C:\temp\sch\base.xsd'.
         Error location: xs:schema / xs:redefine / xs:group
         Details
             sch-props-correct.2: 'essai' is already declared in schema 
document 'C:\temp\sch\base.xsd'.

When trying to write this schema, my assumption was a little bit DTD 
like interpretation : the first defininition is the right one.

Pierre

Le 20/03/2013 18:56, Pierre Attar a écrit :
> Hi,
>
> I have a problem using group redefinitions and validating both with 
> XMLSpy (who complains) and Oxygen (who validates).
> My question : who is correct ? Where a I wrong ?
>
> Note: my schema are a lot more complex but I try to make a sample (non 
> realistic) in order to isolate my question.
>
> Here is the situation :
>
> base.xsd declares a group called essai :
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="http://modeles.fr/modeles/reference" 
> targetNamespace="http://modeles.fr/modeles/reference" 
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>     <xs:element name="ENTER_NAME_OF_ROOT_ELEMENT_HERE">
>         <xs:annotation>
>             <xs:documentation>Comment describing your root 
> element</xs:documentation>
>         </xs:annotation>
>     </xs:element>
>     <xs:group name="essai">
>         <xs:choice/>
>     </xs:group>
> </xs:schema>
>
>
> other.xsd only includes base.xsd
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="http://modeles.fr/modeles/reference" 
> targetNamespace="http://modeles.fr/modeles/reference" 
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>     <xs:include schemaLocation="base.xsd"/>
> </xs:schema>
>
>
> And now, redefine .xsd both redefine base.xsd and includes other.xsd
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> xmlns="http://modeles.fr/modeles/reference" 
> targetNamespace="http://modeles.fr/modeles/reference" 
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>     <xs:redefine schemaLocation="base.xsd">
>         <xs:group name="essai">
>             <xs:choice>
>                 <xs:group ref="essai"/>
>                 <xs:element name="test"/>
>             </xs:choice>
>         </xs:group>
>     </xs:redefine>
>     <xs:include schemaLocation="other.xsd"/>
> </xs:schema>
>
>
> At this time, XML spy complains but not oxygen 14.2. If I remove the 
> include, no problem found.
>
> Any ideas ?
>
> Pierre
>
>
>
>

Received on Monday, 25 March 2013 08:50:00 UTC