7 #include "vymprocess.h"
13 xsltprocessor = "xsltproc";
15 dia = new ShowTextDialog;
18 XSLTProc::~XSLTProc() { delete (dia); }
20 void XSLTProc::addStringParam(const QString &k, const QString &v)
22 stringParamKey.append(k);
23 stringParamVal.append(v);
26 void XSLTProc::setOutputFile(const QString &s) { outputFile = s; }
28 void XSLTProc::setXSLFile(const QString &s) { xslFile = s; }
30 void XSLTProc::setInputFile(const QString &s) { inputFile = s; }
32 void XSLTProc::addOutput(const QString &s) { dia->append(s); }
34 void XSLTProc::process()
37 dia.useFixedFont(true);
39 VymProcess *xsltProc = new VymProcess();
41 QStringList::Iterator itk;
42 QStringList::Iterator itv = stringParamVal.begin();
44 for (itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk) {
45 args << "--stringparam";
55 QString com = xsltprocessor + " " + args.join(" ");
57 qDebug() << "xsltproc executing:\n" << qPrintable(com);
58 dia.append("vym is executing: \n" + com);
59 xsltProc->start(xsltprocessor, args);
60 if (!xsltProc->waitForStarted()) {
61 QMessageBox::critical(
62 0, QObject::tr("Critical Error"),
63 QObject::tr("Could not start %1").arg(xsltprocessor));
66 if (!xsltProc->waitForFinished()) {
67 QMessageBox::critical(
68 0, QObject::tr("Critical Error"),
69 QObject::tr("%1 didn't exit normally").arg(xsltprocessor) +
70 xsltProc->getErrout());
71 if (xsltProc->exitStatus() > 0)
76 dia.append(xsltProc->getErrout());
77 dia.append(xsltProc->getStdout());