4 #include <qmessagebox.h>
13 xsltprocessor="xsltproc";
15 dia=new ShowTextDialog;
18 XSLTProc::~XSLTProc ()
23 void XSLTProc::addStringParam (const QString & k, const QString &v)
25 stringParamKey.append (k);
26 stringParamVal.append (v);
29 void XSLTProc::setOutputFile (const QString &s)
34 void XSLTProc::setXSLFile(const QString &s)
39 void XSLTProc::setInputFile (const QString &s)
44 void XSLTProc::addOutput (const QString &s)
49 void XSLTProc::process()
53 Process *xsltProc=new Process ();
55 QStringList::Iterator itk;
56 QStringList::Iterator itv=stringParamVal.begin();
58 for ( itk = stringParamKey.begin(); itk != stringParamKey.end(); ++itk )
60 args << "--stringparam";
70 QString com=xsltprocessor+" "+args.join(" ");
71 if (debug) cout <<"xsltproc executing:\n"<<com.ascii()<<endl;
72 dia.append ("vym is executing: \n" + com );
73 xsltProc->start(xsltprocessor,args);
74 if (!xsltProc->waitForStarted() )
76 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
77 QObject::tr("Could not start %1").arg(xsltprocessor) );
80 if (!xsltProc->waitForFinished())
81 QMessageBox::critical( 0, QObject::tr( "Critical Error" ),
82 QObject::tr("%1 didn't exit normally").arg(xsltprocessor) +
83 xsltProc->getErrout() );
85 if (xsltProc->exitStatus()>0) showOutput=true;
89 dia.append (xsltProc->getErrout());
90 dia.append (xsltProc->getStdout());
92 if (showOutput) dia.exec();