
// This example uses an xml and xslt source file, and outputs the result to an html file.
// This example is pretty much straight from the basic usage guide online.


// 1. include required headers
//
#include <Include/PlatformDefinitions.hpp>
#include <util/PlatformUtils.hpp>
#include <XalanTransformer/XalanTransformer.hpp>



#include <iostream>

using namespace std;
int main(void)
{

	// 2. Initialize Xerces and Xalan
	XMLPlatformUtils::Initialize();
	XalanTransformer::initialize();

	// 3. Create a XalanTransformer
	XalanTransformer theXalanTransformer;

	// 4. Prepare the input and output sources
	XSLTInputSource xmlIn("foo.xml");
	XSLTInputSource xslIn("foo.xsl");
	XSLTResultTarget xmlOut("foo-out.xml");

	// 5. Perform the transformation
	//
	int theResult = theXalanTransformer.transform(xmlIn, xslIn, xmlOut);
	
	cout << "Result of Transformation is " << theResult << "\n";


	// 5. Shutdown the transformation thingy...
	XalanTransformer::terminate();
	XMLPlatformUtils::Terminate();
	XalanTransformer::ICUCleanUp();
	return 0;
}


