Note that there are some explanatory texts on larger screens.

plurals
  1. POXSLT Grouping with addition/combination of sub elements
    primarykey
    data
    text
    <p>I have the following XML</p> <pre><code> &lt;InvestmentAccount Id="Element01_Source3_Sequqence002" Type="Standard" InvestmentStrategyId="Employer" ParameterOverrideIds="AllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="4754.82" /&gt; &lt;Investment FundName="Fund034" FundValue="4643.48" /&gt; &lt;Investment FundName="Fund035" FundValue="2509.46" /&gt; &lt;Investment FundName="Fund038" FundValue="7104.71" /&gt; &lt;Investment FundName="Fund042" FundValue="4244.08" /&gt; &lt;/InvestmentAccount&gt; &lt;InvestmentAccount Id="Element01_Source4_Sequence003" Type="DWPRebate" InvestmentStrategyId="DSS" ParameterOverrideIds="DWPAllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="1881.76" /&gt; &lt;Investment FundName="Fund034" FundValue="1584.18" /&gt; &lt;Investment FundName="Fund035" FundValue="872.99" /&gt; &lt;Investment FundName="Fund038" FundValue="2899.53" /&gt; &lt;Investment FundName="Fund042" FundValue="1762.62" /&gt; &lt;/InvestmentAccount&gt; &lt;InvestmentAccount Id="Element01_Source2_Sequence001" Type="Standard" InvestmentStrategyId="Employee" ParameterOverrideIds="AllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="7395.91" /&gt; &lt;Investment FundName="Fund034" FundValue="7222.72" /&gt; &lt;Investment FundName="Fund035" FundValue="3903.52" /&gt; &lt;Investment FundName="Fund038" FundValue="11051.32" /&gt; &lt;Investment FundName="Fund042" FundValue="6602.54" /&gt; &lt;/InvestmentAccount&gt; &lt;InvestmentAccount Id="Element02_Source2_Sequence004" Type="TransferNonPR" InvestmentStrategyId="Employee" ParameterOverrideIds="AllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="1439.29" /&gt; &lt;Investment FundName="Fund034" FundValue="1614.31" /&gt; &lt;Investment FundName="Fund035" FundValue="863.68" /&gt; &lt;Investment FundName="Fund038" FundValue="2153.80" /&gt; &lt;Investment FundName="Fund042" FundValue="1306.45" /&gt; &lt;/InvestmentAccount&gt; &lt;InvestmentAccount Id="Element03_Source2_Sequence005" Type="TransferNonPR" InvestmentStrategyId="Employee" ParameterOverrideIds="AllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="9617.42" /&gt; &lt;Investment FundName="Fund034" FundValue="10787.03" /&gt; &lt;Investment FundName="Fund035" FundValue="5771.18" /&gt; &lt;Investment FundName="Fund038" FundValue="14391.20" /&gt; &lt;Investment FundName="Fund042" FundValue="8729.81" /&gt; &lt;Investment FundName="fictiousextra" FundValue="1414" /&gt; &lt;/InvestmentAccount&gt; </code></pre> <p>What I'd like to do is where InvestmentStrategyId AND Type are the same as is the case with the the last 2 above (reorder for clarity) is where the FundName is the same I need to sum the fund values. In this case there are the same in each side but there might be some extra or less on each side.</p> <p>So the result is I need access to FundName and either FundValue or I can sum or an already summed value.</p> <p>Help!</p> <p>Right so this is the output I am trying to achieve.</p> <pre><code> &lt;InvestmentAccount Id="Element01_Source3_Sequence002" Type="Standard" InvestmentStrategyId="Employer" ParameterOverrideIds="AllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="4754.82" /&gt; &lt;Investment FundName="Fund034" FundValue="4643.48" /&gt; &lt;Investment FundName="Fund035" FundValue="2509.46" /&gt; &lt;Investment FundName="Fund038" FundValue="7104.71" /&gt; &lt;Investment FundName="Fund042" FundValue="4244.08" /&gt; &lt;/InvestmentAccount&gt; &lt;InvestmentAccount Id="Element01_Source4_Sequence003" Type="DWPRebate" InvestmentStrategyId="DSS" ParameterOverrideIds="DWPAllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="1881.76" /&gt; &lt;Investment FundName="Fund034" FundValue="1584.18" /&gt; &lt;Investment FundName="Fund035" FundValue="872.99" /&gt; &lt;Investment FundName="Fund038" FundValue="2899.53" /&gt; &lt;Investment FundName="Fund042" FundValue="1762.62" /&gt; &lt;/InvestmentAccount&gt; &lt;InvestmentAccount Id="Element01_Source2_Sequence001" Type="Standard" InvestmentStrategyId="Employee" ParameterOverrideIds="AllocationRateOverride"&gt; &lt;Investment FundName="Fund032" FundValue="7395.91" /&gt; &lt;Investment FundName="Fund034" FundValue="7222.72" /&gt; &lt;Investment FundName="Fund035" FundValue="3903.52" /&gt; &lt;Investment FundName="Fund038" FundValue="11051.32" /&gt; &lt;Investment FundName="Fund042" FundValue="6602.54" /&gt; &lt;/InvestmentAccount&gt; &lt;!-- THIS ONE IS THE SUMMED COMBINTION DUE TO InvestmentStrategyId and Type being multiply occuring --&gt; &lt;InvestmentAccount ...&gt; &lt;Investment FundName="Fund032" FundValue="11056.71" /&gt; &lt;Investment FundName="Fund034" FundValue="12401.34" /&gt; &lt;Investment FundName="Fund035" FundValue="6634.86" /&gt; &lt;Investment FundName="Fund038" FundValue="16545" /&gt; &lt;Investment FundName="Fund042" FundValue="10036.26" /&gt; &lt;Investment FundName="fictiousextra" FundValue="1414" /&gt; &lt;/InvestmentAccount&gt; </code></pre> <p>Including any FundNames that are present in 1 and not the other.</p> <p>I should add I am running using .net 4.0</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload