I've looked at the FAQs, but have had a hard time making any certain methods
work. I basically have XML that has a PaymentType, City, Date and ID. I
need to group all records by PaymentType then by City. I need to total by
city and by Payment type. Here is some sample XML.
<?xml version="1.0" encoding="UTF-16"?>
<ArrayOfAccountLineItems>
<AccountLineItem>
<ID>12993</ID>
<PaymentType>Credit Card</PaymentType>
<SettleDate>2004-04-14T22:57:46.6230000-04:00</SettleDate>
<CityName>Las Vegas</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12992</ID>
<PaymentType>Cash</PaymentType>
<SettleDate>2004-04-14T22:57:46.6230000-04:00</SettleDate>
<CityName>New York</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12963</ID>
<PaymentType>Check</PaymentType>
<SettleDate>2004-04-14T22:57:51.3100000-04:00</SettleDate>
<CityName>Orlando</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12962</ID>
<PaymentType>Check</PaymentType>
<SettleDate>2004-04-14T22:57:51.3100000-04:00</SettleDate>
<CityName>New York</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12969</ID>
<PaymentType>Credit Card</PaymentType>
<SettleDate>2004-04-14T22:57:51.4830000-04:00</SettleDate>
<CityName>Las Vegas</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12968</ID>
<PaymentType>Voucher</PaymentType>
<SettleDate>2004-04-14T22:57:51.4830000-04:00</SettleDate>
<CityName>Orlando</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12975</ID>
<PaymentType>Check</PaymentType>
<SettleDate>2004-04-14T22:57:51.6400000-04:00</SettleDate>
<CityName>Las Vegas</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12974</ID>
<PaymentType>Check</PaymentType>
<SettleDate>2004-04-14T22:57:51.6400000-04:00</SettleDate>
<CityName>Orlando</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12981</ID>
<PaymentType>Voucher</PaymentType>
<SettleDate>2004-04-14T22:57:51.8100000-04:00</SettleDate>
<CityName>New York</CityName>
</AccountLineItem>
<AccountLineItem>
<ID>12980</ID>
<PaymentType>Cash</PaymentType>
<SettleDate>2004-04-14T22:57:51.8100000-04:00</SettleDate>
<CityName>Orlando</CityName>
</AccountLineItem>
</ArrayOfAccountLineItems>
II have been trying the for-each PaymentType[not(. =
preceding::PaymentType)] approach.
Any thoughts on the best way to tackle this?
Thanks.