#include <base/Application.h>
#include <base/string/FormatOutputStream.h>
#include <base/io/File.h>
#include <base/xml/Document.h>
#include <base/xml/Stylesheet.h>
#include <base/xml/Transformer.h>
#include <base/collection/Stack.h>
#include <base/collection/Array.h>
using namespace com::azure::dev::base;
private:
static const unsigned int MAJOR_VERSION = 1;
static const unsigned int MINOR_VERSION = 0;
public:
XSLTProcessorApplication()
{
}
void main()
{
fout << getFormalName() << " version "
<< MAJOR_VERSION << '.' << MINOR_VERSION << EOL
<< "The Base Framework (Test Suite)" << EOL
<< ENDL;
fout << getFormalName() << " source destination" << ENDL;
return;
}
const String sourceName = arguments[0];
const String destinationName = arguments[1];
{
fout << "Reading XML file into buffer..." << ENDL;
}
fout << "Reading document" << ENDL;
source.
save(sourceName +
".saved");
fout << "Reading stylesheet..." << ENDL;
xslDocument.
save(destinationName +
".saved");
fout << "Stylesheet" << EOL
<< indent(2) << "output method: "
<< stylesheet.
getOutputMethod() << EOL
<< indent(2) << "namespace: "
<< stylesheet.
getNamespace() << EOL
<< indent(2) << "version: "
<< stylesheet.
getVersion() << EOL
<< indent(2) << "encoding: "
<< stylesheet.
getEncoding() << EOL
<< ENDL;
MESSAGE("projectname"),
MESSAGE("Base framework")
);
fout << "Transforming document..." << ENDL;
fout << "Saving result document..." << ENDL;
transformer.
save(arguments[2], result);
}
};
APPLICATION_STUB(XSLTProcessorApplication);