W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: Required attribute 'ref' of parent element

From: Eddie Robertsson <eddie@allette.com.au>
Date: Mon, 22 Oct 2001 11:00:38 +1000
Message-ID: <3BD36FB6.3A24C90F@allette.com.au>
To: espen.dietrichs@Storebrand.no
CC: xmlschema-dev@w3.org
Hi Espen,

>   <!-- bankkonto.kontonumre -->
>   <complexType name="bankkonto.kontonumre.input">
>     <choice>
>       <element name="deltjenestereferanse" type="tj:tjenestereferanseType
> "/>
>       <group>
>         <sequence>
>            <element name="kontrollparametre" type="tj:kontrollparametreType
> " minOccurs="0"/>
>            <element name="fn" type="felles:fn"/>
>         </sequence>
>       </group>
>     </choice>
>   </complexType>

You get an error in the above complexType because you're not allowed to declare
a group locally. If you want to decalre a new Group it needs to be declared
globally (immediate child of the xs:schema element) and it must also have a
"name" attribute. You can then reference a global group from within
complexTypes like this:

<xs:group ref="name of global group" ...>

However, in your case above it seems you only want to nest a sequence group
within a choice group so just remove your "group" declaration and it should
work fine. So, your complexType should be:

  <!-- bankkonto.kontonumre -->
  <complexType name="bankkonto.kontonumre.input">
    <choice>
      <element name="deltjenestereferanse" type="tj:tjenestereferanseType"/>
      <sequence>
        <element name="kontrollparametre" type="tj:kontrollparametreType"
minOccurs="0"/>
        <element name="fn" type="felles:fn"/>
      </sequence>
    </choice>
  </complexType>

Cheers,
/Eddie
Received on Sunday, 21 October 2001 20:54:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT