title: Set an attribute/value of a custom Complex Type
body: <p>I have created a my own ComplexType - Transaction.</p>
  
  <p>I would like to set an attribute of that complex type by default from the calling element.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;xs:complexType name="TransactionType"&gt;
    &lt;xs:all minOccurs="0" maxOccurs="1"&gt;
      &lt;xs:element name="Status" type="xs:string" minOccurs="1" fixed ="N" maxOccurs ="1" /&gt;
      &lt;xs:element name="Amount" type="xs:decimal" minOccurs ="1" maxOccurs ="1" /&gt;
    &lt;/xs:all&gt;
    &lt;xs:attribute name="type" type="xs:string" /&gt;
  &lt;/xs:complexType&gt;
  
  &lt;xs:element name="Transaction" maxOccurs="unbounded"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="Debit" type="TransactionType" /&gt;
        &lt;xs:element name="Credit" type="TransactionType" /&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>For Debit i would like to have a fixed value TransactionType.Type = "D", and for the Credit element i would like it to be transactionType.Type = "C"</p>
  
  <p>Thanks</p>