xml でのグループ化について質問があります。
- 最初の問題は、xml に行をグループ化するための構造がないことです。順序は問題ありません。
- 2番目の問題は、グループ化の要素が前のものと同じである場合、繰り返されないという事実です。
グループ化は BodyCustQuotationTrans -detaillines で行う必要があります。最初のレベルは UnitID、2 番目のレベルは objectgroupID です。
誰かが助けてくれたらどうもありがとう!
入力 XML:
<?xml version="1.0" encoding="UTF-8"?>
<Report Name="SalesQuotation" Caption="Offerte" Language="EN">
<Quotation>
<CustQuotationJour_DeliveryName>Testcustomer</CustQuotationJour_DeliveryName>
<CustQuotationJour_DeliveryAddress>101 street 3293 CITY</CustQuotationJour_DeliveryAddress>
<QuotationTxt>Quotation</QuotationTxt>
</Quotation>
<Lines>
<BodyCustQuotationTrans>
<ItemId>1006055</ItemId>
<CustQuotationTrans_Name>Laufen Pro kunststof bad 180x80cm WIT ZO</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>511,00</CustQuotationTrans_SalesPrice>
<UnitID>Bathroom</UnitID>
<UnitNumber>1,00</UnitNumber>
<ObjectgroupID>Bath</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1036625</ItemId>
<CustQuotationTrans_Name>Set Laufen badpoten (instelbaar) voor Pr</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>38,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1038952</ItemId>
<CustQuotationTrans_Name>Chroom badafvoer-overloopkomb.1 ½ met wa</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>56,90</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1007857</ItemId>
<CustQuotationTrans_Name>Grohtherm 2000 badthermostaat 15cm chr z</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>353,65</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>2061780</ItemId>
<CustQuotationTrans_Name>Easy Drain COMPACT 50 1000mm met rooster</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>1,00</UnitNumber>
<ObjectgroupID>Shower</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>2062352</ItemId>
<CustQuotationTrans_Name>Easy 2 Seal afdichtingspasta voor o.a. E</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1007831</ItemId>
<CustQuotationTrans_Name>Grohtherm 2000 douchethermostaat 15cm ch</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>4044377</ItemId>
<CustQuotationTrans_Name>Vasco Arabis Bathroomradiator typ HDRM33</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>1,00</UnitNumber>
<ObjectgroupID>Radiator</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>4044689</ItemId>
<CustQuotationTrans_Name>Vasco designventielset met thermost.knop</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1033033</ItemId>
<CustQuotationTrans_Name>GEBERIT DUOFIX, DE ECHTE!!!</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>Toiletruim</UnitID>
<UnitNumber>1,00</UnitNumber>
<ObjectgroupID>Closet</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1033358</ItemId>
<CustQuotationTrans_Name>Geberit bedieningsplaat Samba frontbed.</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1027975</ItemId>
<CustQuotationTrans_Name>Plaatstalen uitstortgootsteen 51x36 wit</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>Kitchen</UnitID>
<UnitNumber>1,00</UnitNumber>
<ObjectgroupID>Sinc</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1027988</ItemId>
<CustQuotationTrans_Name>Alape emmerrooster aluminium kleur voor</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1039264</ItemId>
<CustQuotationTrans_Name>Syfon universeel 1 1/2"x 40 mm. Mc.alpin</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>9,90</CustQuotationTrans_SalesPrice>
<UnitID_LABEL>Unit ID</UnitID_LABEL>
<UnitID>
</UnitID>
<UnitNumber>
</UnitNumber>
<ObjectgroupID>
</ObjectgroupID>
</BodyCustQuotationTrans>
</Lines>
<Totals>
<CustQuotationJour_SalesBalance>5.082,19</CustQuotationJour_SalesBalance>
<CustQuotationJour_EndDisc>0,00</CustQuotationJour_EndDisc>
<CustQuotationJour_SumMarkup>0,00</CustQuotationJour_SumMarkup>
<CustQuotationJour_SumTax>1.067,26</CustQuotationJour_SumTax>
<CustQuotationJour_RoundOff>0,00</CustQuotationJour_RoundOff>
<CustQuotationJour_QuotationAmount>6.149,45</CustQuotationJour_QuotationAmount>
<CustQuotationJour_CurrencyCode>EUR</CustQuotationJour_CurrencyCode>
</Totals>
</Report>
結果は次のようになります。
<?xml version="1.0" encoding="UTF-8"?>
<Report Name="SalesQuotation" Caption="Offerte" Language="NL">
<Quotation>
<CustQuotationJour_DeliveryName>Testcustomer</CustQuotationJour_DeliveryName>
<CustQuotationJour_DeliveryAddress>101 street 3293 CITY</CustQuotationJour_DeliveryAddress>
<QuotationTxt>Quotation</QuotationTxt>
</Quotation>
<Lines>
<Unit>
<UnitID>Bathroom</UnitID>
<UnitNumber>1,00</UnitNumber>
<Objectgroup>
<ObjectgroupID>Bath</ObjectgroupID>
<BodyCustQuotationTrans>
<ItemId>1006055</ItemId>
<CustQuotationTrans_Name>Laufen Pro kunststof bad 180x80cm WIT ZO</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>511,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1036625</ItemId>
<CustQuotationTrans_Name>Set Laufen badpoten (instelbaar) voor Pr</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>38,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1038952</ItemId>
<CustQuotationTrans_Name>Chroom badafvoer-overloopkomb.1 ½ met wa</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>56,90</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1007857</ItemId>
<CustQuotationTrans_Name>Grohtherm 2000 badthermostaat 15cm chr z</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>353,65</CustQuotationTrans_SalesPrice>
<UnitID_LABEL>Unit ID</UnitID_LABEL>
</BodyCustQuotationTrans>
<Subtotalgroup>959,55</Subtotalgroup>
</Objectgroup>
<Objectgroup>
<ObjectgroupID>Shower</ObjectgroupID>
<BodyCustQuotationTrans>
<ItemId>2061780</ItemId>
<CustQuotationTrans_Name>Easy Drain COMPACT 50 1000mm met rooster</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>2062352</ItemId>
<CustQuotationTrans_Name>Easy 2 Seal afdichtingspasta voor o.a. E</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1007831</ItemId>
<CustQuotationTrans_Name>Grohtherm 2000 douchethermostaat 15cm ch</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<Subtotalgroup>60</Subtotalgroup>
</Objectgroup>
<Objectgroup>
<ObjectgroupID>Radiator</ObjectgroupID>
<BodyCustQuotationTrans>
<ItemId>4044377</ItemId>
<CustQuotationTrans_Name>Vasco Arabis Bathroomradiator typ HDRM33</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>4044689</ItemId>
<CustQuotationTrans_Name>Vasco designventielset met thermost.knop</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<Subtotalgroup>40</Subtotalgroup>
</Objectgroup>
<Subtotalunit>1059,55</Subtotalunit>
</Unit>
<Unit>
<UnitID>Toilet</UnitID>
<UnitNumber>1,00</UnitNumber>
<objectgroup>
<ObjectgroupID>Closet</ObjectgroupID>
<BodyCustQuotationTrans>
<ItemId>1033033</ItemId>
<CustQuotationTrans_Name>GEBERIT DUOFIX, DE ECHTE!!!</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1033358</ItemId>
<CustQuotationTrans_Name>Geberit bedieningsplaat Samba frontbed.</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<Subtotalgroup>40</Subtotalgroup>
</objectgroup>
<Subtotalunit>40</Subtotalunit>
</Unit>
<Unit>
<UnitID>Kitchen</UnitID>
<UnitNumber>1,00</UnitNumber>
<objectgroup>
<ObjectgroupID>Sinc</ObjectgroupID>
<BodyCustQuotationTrans>
<ItemId>1027975</ItemId>
<CustQuotationTrans_Name>Plaatstalen uitstortgootsteen 51x36 wit</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1027988</ItemId>
<CustQuotationTrans_Name>Alape emmerrooster aluminium kleur voor</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>20,00</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<BodyCustQuotationTrans>
<ItemId>1039264</ItemId>
<CustQuotationTrans_Name>Syfon universeel 1 1/2"x 40 mm. Mc.alpin</CustQuotationTrans_Name>
<CustQuotationTrans_Qty>1,00</CustQuotationTrans_Qty>
<salesUnitTxt>ST</salesUnitTxt>
<CustQuotationTrans_SalesPrice>9,90</CustQuotationTrans_SalesPrice>
</BodyCustQuotationTrans>
<Subtotalgroup>49,90</Subtotalgroup>
</objectgroup>
<Subtotalunit>49,90</Subtotalunit>
</Unit>
</Lines>
<Totals>
<CustQuotationJour_SalesBalance>5.082,19</CustQuotationJour_SalesBalance>
<CustQuotationJour_EndDisc>0,00</CustQuotationJour_EndDisc>
<CustQuotationJour_SumMarkup>0,00</CustQuotationJour_SumMarkup>
<CustQuotationJour_SumTax>1.067,26</CustQuotationJour_SumTax>
<CustQuotationJour_RoundOff>0,00</CustQuotationJour_RoundOff>
<CustQuotationJour_QuotationAmount>6.149,45</CustQuotationJour_QuotationAmount>
<CustQuotationJour_CurrencyCode>EUR</CustQuotationJour_CurrencyCode>
</Totals>
</Report>