restriction problem, attribute from an nested element

i have 2 abstract type defined:

<xs:complexType name="InputHeaderType" id="InputHeaderType"
abstract="false">
<xs:complexContent>
<xs:restriction base="xs:anyType">
    <xs:sequence/>
    <xs:attribute name="InputField" type="sg:InputFieldType"
use="required"/>
    <xs:attribute name="keyfield" type="sg:KeyfieldType"
use="required"/>
    <xs:attribute name="FieldX" type="sg:FieldXType" use="required"/>
  </xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="OutputHeaderType" id="OutputHeaderType"
abstract="false">
<xs:complexContent>
<xs:restriction base="xs:anyType">
    <xs:sequence/>
    <xs:attribute name="OutputField" type="sg:OutputFieldType"
use="required"/>
    <xs:attribute name="keyfield" type="sg:KeyfieldType"
use="required"/>
    <xs:attribute name="FieldY" type="sg:FieldYType" use="required"/>
  </xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:complexType name ="HeaderType">
  <xs:choice>
    <xs:element name="InputHeader" type="sg:InputHeaderType"/>
    <xs:element name="OutputHeader" type="sg:OutputHeaderType"/>
  </xs:choice>
</xs:complexType>

I want something as below, but errors appear.
Can i use an attribute from one of the inside element?
I can create XXInputHeaderType, XXHeaderOutputType but i preffer
something like this.

<xs:complexType name="XXHeaderType">
<xs:complexContent>
   <xs:restriction base="sg:HeaderType">
     <xs:attribute name="keyfield" type="sg:keyfieldType"
use="required" fixed="XX"/>
   </xs:restriction>
</xs:complexContent>
</xs:complexType>

Thanks.

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

Received on Monday, 10 November 2003 02:53:32 UTC