Listing 6: Parsing an XML document.

#pragma warning (disable:4786)
#include "DocumentContentHandler.h"
#include "CustomerOrderProcessor.h"
#include <iostream>
int main()
{
     typedef DocumentContentHandler<CustomerOrder, CustomerOrderProcessor> 
     
                                                       CustomerOrderHandler;
    ::CoInitialize(NULL);
    CustomerOrderProcessor order_processor;
    CustomerOrderHandler   order_handler(L"BookedOrders", &order_processor);
    order_handler.Setup();
    XmlString URL(L"CustomerOrder.xml");
    HRESULT hr = order_handler.Parse(URL);
    std::wcout << L"All Customer Order Processing Finished." << std::endl; 
    ::CoUninitialize();
    return 0;
}