title: Export denormalized data from excel to xml
body: <p>We are trying to export an excel table with "Denormalized Data" to xml. The table headers are as follows:</p>
  
  <pre><code>| AssetManager Code | AssetManager Date | Portfolio Code | Portfolio Name | MarketValue | NetCashFlow | Field | Field Code | Field Name |
  </code></pre>
  
  <p>The AssetManager Code and AssetManager Date are the same throughout, the rest of the columns contain variable data.</p>
  
  <p>Here is an example of the xml output we want:</p>
  
  <pre><code>&lt;AssetManager Code="PFM" Date="20130117"&gt;                   
      &lt;Portfolios&gt;            
          &lt;Portfolio Code="CC PSP" Name="Consilium Capital"&gt;      
              &lt;MarketValue&gt;5548056.51&lt;/MarketValue&gt;   
              &lt;NetCashFlow&gt;0&lt;/NetCashFlow&gt;    
              &lt;UserFields&gt;    
                  &lt;Field Code="AM UCGT" Name="AM daily Unrealised CG"&gt;4375&lt;/Field&gt;
              &lt;/UserFields&gt;   
          &lt;/Portfolio&gt;        
          &lt;Portfolio Code="MM (FC)" Name="Money Market UT (FC)"&gt;      
              &lt;MarketValue&gt;28975149.6500735&lt;/MarketValue&gt; 
              &lt;NetCashFlow&gt;0&lt;/NetCashFlow&gt;    
              &lt;UserFields&gt;    
                  &lt;Field Code="UCGT" Name="AM daily Unrealised CG"&gt;0&lt;/Field&gt;
              &lt;/UserFields&gt;   
          &lt;/Portfolio&gt;        
      &lt;/Portfolios&gt;           
  &lt;/AssetManager&gt; 
  </code></pre>
  
  <p>And our xsd file containing the mappings:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="AssetManager"&gt;
      &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
                      &lt;xs:element ref="Portfolios" /&gt;
              &lt;/xs:sequence&gt;
          &lt;xs:attribute name="Code" type="xs:string"/&gt;
              &lt;xs:attribute name="Date" type="xs:string"/&gt;
      &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="FieldType"&gt;
      &lt;xs:simpleContent&gt;
          &lt;xs:extension base="xs:decimal"&gt;
              &lt;xs:attribute name="Code" type="xs:string"/&gt;
                  &lt;xs:attribute name="Name" type="xs:string"/&gt;
          &lt;/xs:extension&gt;
      &lt;/xs:simpleContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="Portfolios"&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="Portfolio"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element name="MarketValue" type="xs:decimal"/&gt;
          &lt;xs:element name="NetCashFlow" type="xs:decimal"/&gt;
          &lt;xs:element name="UserFields"&gt;
            &lt;xs:complexType&gt;
              &lt;xs:sequence&gt;
                      &lt;xs:element name="Field" type="FieldType"/&gt;
              &lt;/xs:sequence&gt;
            &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="Code" type="xs:string"/&gt;
        &lt;xs:attribute name="Name" type="xs:string"/&gt;
      &lt;/xs:complexType&gt;
                &lt;/xs:element&gt;
              &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>At the very least we'd like to know why excel considers data denormalised?</p>
  
  <p>Any help will be much appreciated.</p>