7 #include "vymprocess.h"
14 xsltprocessor="xsltproc";
16 dia=new ShowTextDialog;
19 XSLTProc::~XSLTProc ()
24 void XSLTProc::addStringParam (const QString & k, const QString &v)
26 stringParamKey.append (k);
27 stringParamVal.append (v);
30 void XSLTProc::setOutputFile (const QString &s)
35 void XSLTProc::setXSLFile(const QString &s)
40 void XSLTProc::setInputFile (const QString &s)
45 void XSLTProc::addOutput (const QString &s)
50 void XSLTProc::process()
53 dia.useFixedFont (true);
55 VymProcess *xsltProc=new VymProcess ();
57 QStringList::Iterator itk;
58 QStringList::Iterator itv=stringParamVal.begin();
60 for ( itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk )
62 args << "--stringparam";
72 QString com=xsltprocessor+" "+args.join(" ");
73 if (debug) qDebug() <<"xsltproc executing:\n"<<qPrintable(com);
74 dia.append ("vym is executing: \n" + com );
75 xsltProc->start(xsltprocessor,args);
76 if (!xsltProc->waitForStarted() )
78 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
79 QObject::tr("Could not start %1").arg(xsltprocessor) );
82 if (!xsltProc->waitForFinished())
84 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
85 QObject::tr("%1 didn't exit normally").arg(xsltprocessor) +
86 xsltProc->getErrout() );
87 if (xsltProc->exitStatus()>0) showOutput=true;
92 dia.append (xsltProc->getErrout());
93 dia.append (xsltProc->getStdout());
95 if (showOutput) dia.exec();